As discussed in the In Depth section of this chapter, date-time pickers let the user select dates and times. Here's the class hierarchy for the DateTimePicker class:
Object MarshalByRefObject Component Control DateTimePicker
You can find the more notable public shared (static) properties of the DateTimePicker class in Table 8.11, the more notable public object properties in Table 8.12, and the more notable events in Table 8.13. Note that as with other Windows forms controls, I am not listing the notable properties, methods, and events DateTimePicker inherits from the Control class, such as the Click event—you can see all that in Chapter 5, Tables 5.1, 5.2, and 5.3.
Property |
Means |
---|---|
MaxDateTime |
Specifies the maximum date value of the date-time picker control. Note that this field is read-only. |
MinDateTime |
Specifies the minimum date value of the date-time picker control. Note that this field is read-only. |
Property |
Means |
---|---|
CalendarFont |
Gets/sets the font style for the calendar. |
CalendarForeColor |
Gets/sets the foreground color of the calendar. |
CalendarMonthBackground |
Gets/sets the background color of the calendar month. |
CalendarTitleBackColor |
Gets/sets the background color of the calendar title. |
CalendarTitleForeColor |
Gets/sets the foreground color of the calendar title. |
CalendarTrailingForeColor |
Gets/sets the foreground color of the calendar trailing dates. |
Checked |
Gets/sets whether the Value property holds a valid date-time value. |
CustomFormat |
Gets/sets a custom date-time format string. |
DropDownAlign |
Gets/sets the alignment of the drop-down calendar on the date-time control. |
Format |
Gets/sets the format of dates and times. |
MaxDate |
Gets/sets the maximum selectable date and time. |
MinDate |
Gets/sets the minimum selectable date and time. |
PreferredHeight |
Holds the preferred height of the date-time picker control. |
ShowCheckBox |
Gets/sets if a check box should appear to the left of a selected date. |
ShowUpDown |
Gets/sets if an up-down control should be used to adjust date-time values. |
Text |
Gets/sets the text in this control. |
Value |
Gets/sets the date-time value. |
Event |
Means |
---|---|
CloseUp |
Occurs when the drop-down calendar disappears. |
DropDown |
Occurs when the drop-down calendar appears. |
FormatChanged |
Occurs when the Format property value has changed. |
ValueChanged |
Occurs when the Value property changes. |