Assembly: System.Design (in system.design.dll)
'Declaration Public Class MenuItemStyleCollectionEditor Inherits CollectionEditor 'Usage Dim instance As MenuItemStyleCollectionEditor
The MenuItemStyleCollectionEditor class provides a user interface for editing the MenuItemStyle elements of MenuItemStyleCollection objects in the associated Menu control at design time, under the control of the MenuDesigner object.
There is a MenuItemStyleCollection associated with each of the LevelMenuItemStyles and LevelSelectedStyles properties of the Menu control. These MenuItemStyleCollection objects are used to apply styles to menu items that depend on their level (nesting depth) in the menu structure.
The MenuItemStyleCollectionEditor is invoked, for example, by selecting the ellipsis button (…) on the LevelMenuItemStyles or LevelSelectedStyles row in the Properties grid of the visual designer.
The CanSelectMultipleInstances method always returns false to indicate that only one object can be selected at a time in the editor. The CreateCollectionForm method creates a new form to display and edit the current MenuItemStyleCollection.
The following code example shows how to use the EditorAttribute attribute to associate the MenuItemStyleCollectionEditor and UITypeEditor classes (the collection editor base class) with a property in a custom control, derived from the WebControl class, that gets and sets a MenuItemStyleCollection collection.
Private menuItemStyles As MenuItemStyleCollection ' Associate the MenuItemStyleCollectionEditor with the ' LevelMenuItemStyles. <EditorAttribute( GetType(System.Web.UI.Design.WebControls. _ MenuItemStyleCollectionEditor), _ GetType(UITypeEditor))> _ Public Property LevelMenuItemStyles() As MenuItemStyleCollection Get Return menuItemStyles End Get Set menuItemStyles = value End Set End Property ' LevelMenuItemStyles