Solved

Help me about DateTimePicker

Posted on 2006-11-18
8
280 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

776 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