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 Handling and Raising 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
Available since 1.1
Return to top