CalendarClosed Event

DatePicker.CalendarClosed Event


Occurs when the drop-down Calendar is closed.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public event RoutedEventHandler CalendarClosed

<DatePicker CalendarClosed="eventhandler"/>

The following example creates a DatePicker and provides instructions to the user. When the user opens or closes the Calendar, the instructions are updated.

  <TextBlock Name="textBlock1" 
             Text="Enter a date or click the calendar."/>
  <DatePicker CalendarOpened="DatePicker_CalendarOpened"
private void DatePicker_CalendarOpened(object sender, RoutedEventArgs e)
    textBlock1.Text = "Select a date from the calendar";

private void DatePicker_CalendarClosed(object sender, RoutedEventArgs e)
    textBlock1.Text = "Enter a date or click the calendar";

.NET Framework
Available since 4.0
Available since 2.0
Return to top
© 2015 Microsoft