Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
The Windows Forms DateTimePicker control 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 MonthCalendar control, which can be used for selecting multiple dates. For more information on the MonthCalendar control, see MonthCalendar Control Overview.
If you wish the DateTimePicker to appear as a control for picking or editing times instead of dates, set the ShowUpDown property to true
and the Format property to Time. For more information see How to: Display Time with the DateTimePicker Control.
When the ShowCheckBox property 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's MaxDate and MinDate properties determine the range of dates and times. The Value property contains the current date and time the control is set to. For details, see How to: Set and Return Dates with the Windows Forms DateTimePicker Control. The values can be displayed in four formats, which are set by the Format property: Long, Short, Time, or Custom. If a custom format is selected, you must set the CustomFormat property to an appropriate string. For details, see How to: Display a Date in a Custom Format with the Windows Forms DateTimePicker Control.
.NET Desktop feedback feedback
.NET Desktop feedback is an open source project. Select a link to provide feedback:
Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Module
Use and understand Controls in a canvas app in Power Apps - Training
Controls help create a better experience for the user and collect the appropriate data. This module helps you understand and use Controls.
Documentation
DateTimePicker Control - Windows Forms .NET Framework
Learn to use the Windows Forms DateTimePicker control to allow the user to select a single item from a list of dates or times.
Set and Return Dates with DateTimePicker Control - Windows Forms .NET Framework
Learn about how to set and return dates with the Windows Forms DateTimePicker control by means of Visual Basic, C#, and CPP code examples.
How to: Display Time with the DateTimePicker Control - Windows Forms .NET Framework
Learn how to use the Windows Forms DateTimePicker control to enable users to select a date and time, and to display that date and time in the specified format.
Display a Date in a Custom Format with DateTimePicker Control - Windows Forms .NET Framework
Learn how to use the Windows Forms DateTimePicker control to format the display of dates and times in the control.