4 Replies - 9908 Views - Last Post: 11 February 2013 - 09:59 AM Rate Topic: -----

#1 keziahcook  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 22-September 12

How can add days in a date

Posted 11 February 2013 - 07:58 AM

In: 02/11/13 --->DatetimePicker
Days: 10 ---->Textbox
Out: 02/21/13

How can I add the number of days in IN DATE that the answer will be automatic in the OUT DATE?
w/out using a button, it just when you type the number days it will auto add.
Is This A Good Question/Topic? 0
  • +

Replies To: How can add days in a date

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9570
  • View blog
  • Posts: 36,240
  • Joined: 12-June 08

Re: How can add days in a date

Posted 11 February 2013 - 08:04 AM

This is not an 'advanced' question - moving to gen-pop vb.net help.

Have you scoped out the 'datetime' namespace? There's a great little method they provide called "AddDays" which takes in a number of days, and returns the datetime that many days later. You should check it out.

http://msdn.microsof...m.datetime.aspx
Was This Post Helpful? 0
  • +
  • -

#3 keziahcook  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 22-September 12

Re: How can add days in a date

Posted 11 February 2013 - 09:38 AM

How can I add the number of days in IN DATE that the answer will be automatic in the OUT DATE?
w/out using a button, it just when you type the number DAYS TEXTBOX it will auto add to the OUT DATE.

OutDateTimePicker.value = InDateTimePicker.Value.AddDays(txtdays.text) is this correct?

Sorry for re posting this topic..

Sorry for re posting this topic..
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9570
  • View blog
  • Posts: 36,240
  • Joined: 12-June 08

Re: How can add days in a date

Posted 11 February 2013 - 09:40 AM

Quote

w/out using a button, it just when you type the number DAYS TEXTBOX it will auto add to the OUT DATE.

Use an event from the textbox. Like 'text changed' or 'validated'. When that fires off use the 'add days' (as I *ALREADY* mentioned), and set your datepicker's value.
Was This Post Helpful? 0
  • +
  • -

#5 keziahcook  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 22-September 12

Re: How can add days in a date

Posted 11 February 2013 - 09:59 AM

THANKS
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1