共用方式為


MenuItem.SubmenuClosed 事件

定義

發生於 IsSubmenuOpen 屬性的狀態變更為 false 時。

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

事件類型

範例

下列範例示範如何呼叫和處理 SubmenuClosed 事件。

<MenuItem Name="submenu" Header="Menu with Submenu" 
          SubmenuOpened="OnSubmenuOpened"
          SubmenuClosed="OnSubmenuClosed">
private void OnSubmenuClosed(object sender, RoutedEventArgs e)
{
    if (sender == e.Source)
    {
        textBlock1.Text = "Submenu is closed.";
    }
}
Private Sub OnSubmenuClosed(ByVal sender As Object, ByVal e As RoutedEventArgs)
    If sender Is e.Source Then
        textBlock1.Text = "Submenu is closed."
    End If
End Sub

備註

路由事件資訊

識別碼欄位 SubmenuClosedEvent
路由策略 鼓 泡
代理人 RoutedEventHandler

適用於