Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 287
  • Last Modified:

Help me about DateTimePicker

How to plus more day to DateTimePicker current
0
free4vn
Asked:
free4vn
  • 3
  • 2
2 Solutions
 
DrAskeCommented:
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 ..
0
 
ozymandiasCommented:
DateTime d = DateTimePicker.Value;
d.AddDays(1d);
DateTimePicker.Value = d;
0
 
AlexFMCommented:
dateTimePicker1.Value = dateTimePicker1.Value.AddDays(1);
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
ozymandiasCommented:
Yes, or as AlexFM shows yoiu can do it as a single line of code...I was just trying to break it down.
0
 
AlexFMCommented:
Actually, DateTime.AddDays returns DateTime and doesn't change current instance, so you version should be changed.
0
 
ozymandiasCommented:
Yes, sorry that should have been :

DateTime d = DateTimePicker.Value;
DateTimePicker.Value = d.AddDays(1d);
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now