MenuItem.OnSubmenuOpened(RoutedEventArgs) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在打开 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)
参数
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