method Menu.Clear ()
Clear the menu items.

TypeDescription

The Clear method clears the items in the menu . Use the Remove method to remove an item. Use the Refresh method if you are clearing the menu bar items. Use the SubMenu property to access the sub menu. Use the Visible property to hide an item. Use the PopupBackColor property to specify the background color for the drop down menus. Use the ItemHeight property to specify the height for the items. Use the Items property to retrieve the items in the menu bar. Use the Images method to load icons at runtime.

The following VB sample clears all items in the control:

With ExMenu1.Items
    .Clear
End With

The following C++ sample clears all items in the control:

m_menu.GetItems().Clear();

The following VB.NET sample clears all items in the control:

With AxExMenu1.Items
    .Clear()
End With

The following C# sample clears all items in the control:

axExMenu1.Items.Clear();

The following VFP sample clears all items in the control:

With thisform.ExMenu1.Items
	.Clear()
EndWith