DateRangeEventArgs Class


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Provides data for the DateChanged or DateSelected events of the MonthCalendar control.

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


type DateRangeEventArgs = 
        inherit EventArgs

System_CAPS_pubmethodDateRangeEventArgs(DateTime, DateTime)

Initializes a new instance of the DateRangeEventArgs class.


Gets the last date/time value in the range that the user has selected.


Gets the first date/time value in the range that the user has selected.


Determines whether the specified object is equal to the current object.(Inherited from Object.)


Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)


Serves as the default hash function. (Inherited from Object.)


Gets the Type of the current instance.(Inherited from Object.)


Creates a shallow copy of the current Object.(Inherited from Object.)


Returns a string that represents the current object.(Inherited from Object.)

The DateChanged event occurs when the currently selected date or range of dates changes; for example, when the user explicitly changes a selection within the current month or when the selection is implicitly changed in response to next/previous month navigation. The DateSelected event occurs when the user explicitly changes a selection. The DateRangeEventArgs constructor specifies the start and end for the new date range that has been selected.


If a single date is selected, the Start and End property values will be equal.

For more information about handling events, see Handling and Raising Events.

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

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

.NET Framework
Available since 1.1

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top