MenuItem.SubmenuOpened 事件
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
發生於 IsSubmenuOpen 屬性的狀態變更為 true
時。
public:
event System::Windows::RoutedEventHandler ^ SubmenuOpened;
public event System.Windows.RoutedEventHandler SubmenuOpened;
member this.SubmenuOpened : System.Windows.RoutedEventHandler
Public Custom Event SubmenuOpened As RoutedEventHandler
事件類型
範例
下列範例示範如何呼叫和處理 SubmenuOpened 事件。
<MenuItem Name="submenu" Header="Menu with Submenu"
SubmenuOpened="OnSubmenuOpened"
SubmenuClosed="OnSubmenuClosed">
private void OnSubmenuOpened(object sender, RoutedEventArgs e)
{
if (sender == e.Source)
{
textBlock1.Text = "Submenu is open.";
}
}
Private Sub OnSubmenuOpened(ByVal sender As Object, ByVal e As RoutedEventArgs)
If sender Is e.Source Then
textBlock1.Text = "Submenu is open."
End If
End Sub
備註
路由事件資訊
識別碼欄位 | SubmenuOpenedEvent |
路由策略 | 鼓 泡 |
代理人 | RoutedEventHandler |