共用方式為


MenuItem.OnSubmenuOpened(RoutedEventArgs) 方法

定義

當開啟 MenuItem 的子功能表時呼叫。

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

參數

e
RoutedEventArgs

SubmenuOpened 事件的事件資料。

範例

此範例示範如何使用 OnSubmenuOpened 方法。

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

適用於