Partager via


DatePicker.CalendarOpened Événement

Définition

Se produit lorsque le Calendar déroulant est ouvert.

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 

Type d'événement

RoutedEventHandler

Exemples

L’exemple suivant crée un DatePicker et fournit des instructions à l’utilisateur. Lorsque l’utilisateur s’ouvre ou ferme, Calendarles instructions sont mises à jour.

<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

Remarques

Utilisation d'attributs XAML

<DatePicker CalendarOpened="eventhandler"/>  

S’applique à