Help me about DateTimePicker

Posted on 2006-11-18
Medium Priority
Last Modified: 2010-04-16
How to plus more day to DateTimePicker current
Question by:free4vn
  • 3
  • 2

Expert Comment

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 ..
LVL 15

Expert Comment

ID: 17971114
DateTime d = DateTimePicker.Value;
DateTimePicker.Value = d;
LVL 48

Accepted Solution

AlexFM earned 252 total points
ID: 17971116
dateTimePicker1.Value = dateTimePicker1.Value.AddDays(1);
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

LVL 15

Expert Comment

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.
LVL 48

Expert Comment

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

Assisted Solution

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

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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Hi, this video explains a free download that you can incorporate into your Access databases, or use stand-alone for contact management. Contacts -- Names, Addresses, Phone Numbers, eMail Addresses, Websites, Lists, Projects, Notes, Attachments…
Free Data Recovery software is an advanced solution from Kernel Tools to recover data and files such as documents, emails, database, media and pictures, etc. It supports recovery from physical & logical drive after a hard disk crash, accidental/inte…

587 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