MonthCalendar.TodayDate Property


Gets or sets the value that is used by MonthCalendar as today's date.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

member TodayDate : DateTime with get, set

Property Value

Type: System.DateTime

A DateTime representing today's date. The default value is the current system date.

Exception Condition

The value is less than the minimum allowable date.


The value is greater than the maximum allowable date.

By default, the TodayDate property returns the current system date, and the TodayDateSet property is false. Setting the TodayDate property sets the TodayDateSet property to true and, from that point, the value returned by the TodayDate property is the one the user sets.

The following code example demonstrates how to use the SelectionStart, TodayDate and SelectionEnd properties. To run the example, paste the following code into a form containing a MonthCalendar control named MonthCalendar1, and call the ShowAWeeksVacationOneMonthFromToday method from the form's constructor or Load event-handling method.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top