共用方式為


MenuItem.OnSubmenuClosed(RoutedEventArgs) 方法

定義

當關閉 MenuItem 的子功能表時呼叫。

protected:
 virtual void OnSubmenuClosed(System::Windows::RoutedEventArgs ^ e);
protected virtual void OnSubmenuClosed (System.Windows.RoutedEventArgs e);
abstract member OnSubmenuClosed : System.Windows.RoutedEventArgs -> unit
override this.OnSubmenuClosed : System.Windows.RoutedEventArgs -> unit
Protected Overridable Sub OnSubmenuClosed (e As RoutedEventArgs)

參數

e
RoutedEventArgs

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

適用於