|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
DateTimePicker Control Overview (Windows Forms)
.NET Framework 2.0
The Windows Formscontrol allows the user to select a single item from a list of dates or times. When used to represent a date, it appears in two parts: a drop-down list with a date represented in text, and a grid that appears when you click on the down-arrow next to the list. The grid looks like the control, which can be used for selecting multiple dates. For more information on the MonthCalendar control, see .
If you wish the DateTimePicker to appear as a control for picking or editing times instead of dates, set theproperty to true and the property to . For more information see .
When theproperty is set to true, a check box is displayed next to the selected date in the control. When the check box is checked, the selected date-time value can be updated. When the check box is empty, the value appears unavailable.
The control'sand properties determine the range of dates and times. The property contains the current date and time the control is set to. For details, see . The values can be displayed in four formats, which are set by the Format property: , , Time, or . If a custom format is selected, you must set the property to an appropriate string. For details, see .