DatePicker.CalendarOpened Ereignis

Definition

Tritt ein, wenn das Calendar-Dropdownelement geöffnet wird.

public:
 event System::Windows::RoutedEventHandler ^ CalendarOpened;
public event System.Windows.RoutedEventHandler CalendarOpened;
member this.CalendarOpened : System.Windows.RoutedEventHandler 
Public Custom Event CalendarOpened As RoutedEventHandler 
Public Event CalendarOpened As RoutedEventHandler 

Ereignistyp

Beispiele

Im folgenden Beispiel wird ein DatePicker erstellt und dem Benutzer Anweisungen bereitgestellt. Wenn der Benutzer die Calendaröffnet oder schließt, werden die Anweisungen aktualisiert.

<StackPanel>
  <TextBlock Name="textBlock1" 
             Text="Enter a date or click the calendar."/>
  <DatePicker CalendarOpened="DatePicker_CalendarOpened"
              CalendarClosed="DatePicker_CalendarClosed"/>
</StackPanel>
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";
}
Private Sub DatePicker_CalendarOpened(
             ByVal sender As System.Object,
             ByVal e As System.Windows.RoutedEventArgs)
    textBlock1.Text = "Select a date from the calendar"
End Sub

Private Sub DatePicker_CalendarClosed(
             ByVal sender As System.Object,
             ByVal e As System.Windows.RoutedEventArgs)
    textBlock1.Text = "Enter a date or click the calendar"
End Sub

Hinweise

Verwendung von XAML-Attributen

<DatePicker CalendarOpened="eventhandler"/>  

Gilt für: