Solved

Help me about DateTimePicker

Posted on 2006-11-18
8
276 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
Comment Utility
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
Comment Utility
DateTime d = DateTimePicker.Value;
d.AddDays(1d);
DateTimePicker.Value = d;
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 63 total points
Comment Utility
dateTimePicker1.Value = dateTimePicker1.Value.AddDays(1);
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 15

Expert Comment

by:ozymandias
Comment Utility
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
Comment Utility
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
Comment Utility
Yes, sorry that should have been :

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

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 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

10 Experts available now in Live!

Get 1:1 Help Now