Solved

Help me about DateTimePicker

Posted on 2006-11-18
8
279 Views
Last Modified: 2010-04-16
How to plus more day to DateTimePicker current
0
Comment
Question by:free4vn
  • 3
  • 2
8 Comments
 
LVL 9

Expert Comment

by:DrAske
ID: 17971050
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
 
LVL 15

Expert Comment

by:ozymandias
ID: 17971114
DateTime d = DateTimePicker.Value;
d.AddDays(1d);
DateTimePicker.Value = d;
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 63 total points
ID: 17971116
dateTimePicker1.Value = dateTimePicker1.Value.AddDays(1);
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 15

Expert Comment

by:ozymandias
ID: 17971162
Yes, or as AlexFM shows yoiu can do it as a single line of code...I was just trying to break it down.
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 17971342
Actually, DateTime.AddDays returns DateTime and doesn't change current instance, so you version should be changed.
0
 
LVL 15

Assisted Solution

by:ozymandias
ozymandias earned 62 total points
ID: 17971407
Yes, sorry that should have been :

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now