DateRangeEventArgs Class

 

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)

System.Object
  System.EventArgs
    System.Windows.Forms.DateRangeEventArgs

type DateRangeEventArgs = 
    class
        inherit EventArgs
    end

NameDescription
System_CAPS_pubmethodDateRangeEventArgs(DateTime, DateTime)

Initializes a new instance of the DateRangeEventArgs class.

NameDescription
System_CAPS_pubpropertyEnd

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

System_CAPS_pubpropertyStart

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

NameDescription
System_CAPS_pubmethodEquals(Object)

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

System_CAPS_protmethodFinalize()

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

System_CAPS_pubmethodGetHashCode()

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

System_CAPS_pubmethodGetType()

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

System_CAPS_protmethodMemberwiseClone()

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

System_CAPS_pubmethodToString()

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.

System_CAPS_noteNote

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
Show: