Link to home
Start Free TrialLog in
Avatar of free4vn
free4vn

asked on

Help me about DateTimePicker

How to plus more day to DateTimePicker current
Avatar of DrAske
DrAske
Flag of Jordan image

could you please explain what you want to do exactly??
becuase the DateTimePicker has already this functionality!! Just place a DateTimePicker on a form and focus the date portion and it will role up or down on up down keys. Same is true for month/years ..
DateTime d = DateTimePicker.Value;
d.AddDays(1d);
DateTimePicker.Value = d;
ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, or as AlexFM shows yoiu can do it as a single line of code...I was just trying to break it down.
Avatar of AlexFM
AlexFM

Actually, DateTime.AddDays returns DateTime and doesn't change current instance, so you version should be changed.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial