NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

MenuItem.IsParent

Gets a value indicating whether the menu item contains child menu items.

[Visual Basic]
Overridable Public ReadOnly Property IsParent As Boolean
[C#]
public bool IsParent {override get;}
[C++]
public: __property virtual bool get_IsParent();
[JScript]
public function get IsParent() : Boolean;

Property Value

true if the the menu item contains child menu items; false if the menu is a standalone menu item.

Remarks

You can use this property in conjunction with the Parent property to navigate in code through an entire menu structure.

Example [Visual Basic]

The following example determines if there are any sub menus associated with a TBD called MenuItem1. If any sub menus exist, it disables them by setting the TBD property to false. The example assumes that there is a MenuItem object created named MenuItem1.

[Visual Basic]

Public Sub DisableMyChildMenus ()
   ' Create a MenuItem to use with For..Each loop.
   Dim tempMenu As New MenuItem
   ' Determine if MenuItem2 is a parent menu.
   If MenuItem2.IsParent = True Then
      ' Loop through all the sub menus.
      For Each tempMenu In MenuItem2.MenuItems
         ' Disable all of the sub menus of MenuItem2.
         tempMenu.Enabled = False
      Next
   End If
End Sub

See Also

MenuItem Class | MenuItem Members | System.WinForms Namespace