Solved

Help me about DateTimePicker

Posted on 2006-11-18
8
282 Views
Last Modified: 2010-04-16
How to plus more day to DateTimePicker current
0
Comment
Question by:free4vn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: 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!

 
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

Industry Leaders: 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!

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

749 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