how to add a week to datetimepicker default value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pelusa
    New Member
    • Nov 2007
    • 9

    #1

    how to add a week to datetimepicker default value

    Hello everyone,

    I have a windows form that has a datetimepicker control in it.

    I need to set the default date of the datetimepicker control to
    todays date + 1 week.

    I was wondering if anyone has an example of how to do this?

    thank you.

    pelusa.
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Originally posted by pelusa
    Hello everyone,

    I have a windows form that has a datetimepicker control in it.

    I need to set the default date of the datetimepicker control to
    todays date + 1 week.

    I was wondering if anyone has an example of how to do this?

    thank you.

    pelusa.
    Can't you just set the value to what you want before it opens?

    Comment

    • abev
      New Member
      • Jan 2008
      • 22

      #3
      Originally posted by pelusa
      Hello everyone,

      I have a windows form that has a datetimepicker control in it.

      I need to set the default date of the datetimepicker control to
      todays date + 1 week.

      I was wondering if anyone has an example of how to do this?

      thank you.

      pelusa.
      Pelusa -

      In the Form Load did you try this:

      Me.DateTimePick er1.Value = dateadd(DateInt erval.Day, 7, Date.Today)

      (Where DateTimePicker1 is the name of your date picker)

      Comment

      Working...