DatePicker.CalendarOpened Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs when the drop-down Calendar is opened.
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
Event Type
Examples
The following example creates a DatePicker and provides instructions to the user. When the user opens or closes the Calendar, the instructions are updated.
<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
Remarks
XAML Attribute Usage
<DatePicker CalendarOpened="eventhandler"/>
Applies to
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET