This documentation is archived and is not being maintained.

MonthCalendar.DateChanged Event

Occurs when the date selected in the MonthCalendar changes.

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

member DateChanged : IEvent<DateRangeEventHandler,

The DateChanged event occurs during any date selection, whether by mouse, keyboard, or code. The DateSelected event is similar, but it occurs only at the end of a date selection made using the mouse.

For more information about handling events, see Consuming Events.

The following code example creates a SelectionRange, sets its Start and End properties, and assigns the SelectionRange to the SelectionRange property of the MonthCalendar control. When the DateChanged event is raised, the Start and End property values are displayed in the text boxes. This example requires that you have a Form with two TextBox controls, a Button, and a MonthCalendar control.

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

The following code example displays a form containing a MonthCalendar control that displays one calendar year. The example demonstrates setting the BackColor, ForeColor, TitleBackColor, TitleForeColor, CalendarDimensions, and TrailingForeColor properties to customize the look of the calendar control. Other properties such as AnnuallyBoldedDates, BoldedDates, and MonthlyBoldedDates are set to customize which dates are bold. The example also sets the FirstDayOfWeek, MaxDate, MinDate, and MaxSelectionCount properties to change the calendar format. The DateSelected and DateChanged events are also handled and their status is displayed on the form.

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

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.