MenuItem.IsSubmenuOpen Property

Gets or sets a value that indicates whether the submenu containing the MenuItem control's children is open.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:

public bool IsSubmenuOpen { get; set; }
/** @property */
public boolean get_IsSubmenuOpen ()

/** @property */
public void set_IsSubmenuOpen (boolean value)

public function get IsSubmenuOpen () : boolean

public function set IsSubmenuOpen (value : boolean)

<object IsSubmenuOpen="bool" .../>

Property Value

Default value is false.

When IsSubmenuOpen is set to true, mouse capture is set to the MenuItem and its subtree.

The following example shows how to use the IsSubmenuOpen property to determine whether a submenu is open.

private void OnSubmenuOpened(object sender, RoutedEventArgs e)

    if (sender == e.Source)
        textBlock1.Text = "Submenu is open.";

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions