MenuItemStyleCollectionEditor 类    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
为关联的 MenuItemStyleCollection 控件中的 Menu 对象提供组件编辑器。
public ref class MenuItemStyleCollectionEditor : System::ComponentModel::Design::CollectionEditorpublic class MenuItemStyleCollectionEditor : System.ComponentModel.Design.CollectionEditortype MenuItemStyleCollectionEditor = class
    inherit CollectionEditorPublic Class MenuItemStyleCollectionEditor
Inherits CollectionEditor- 继承
示例
下面的代码示例演示如何使用EditorAttribute特性将集合编辑器基类 (类与从类派生的自定义控件中的属性(派WebControl生自该类)中的属性相关联MenuItemStyleCollectionEditor和UITypeEditorMenuItemStyleCollection类) (类。
private MenuItemStyleCollection menuItemStyles;
// Associate the MenuItemStyleCollectionEditor with the 
// LevelMenuItemStyles. 
[Editor(typeof(System.Web.UI.Design.WebControls.
    MenuItemStyleCollectionEditor),
    typeof(UITypeEditor))]
public MenuItemStyleCollection LevelMenuItemStyles
{
    get { return menuItemStyles; }
    set { menuItemStyles = value; }
} // LevelMenuItemStyles
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
注解
该MenuItemStyleCollectionEditor类提供了一个用户界面,用于在设计时编辑MenuItemStyle关联Menu控件中对象元素MenuItemStyleCollection,该对象位于该对象的控件MenuDesigner下。
有一个 MenuItemStyleCollection 与控件的每个 LevelMenuItemStyles 和 LevelSelectedStyles 属性 Menu 关联的。 这些 MenuItemStyleCollection 对象用于将样式应用于菜单项,这些项依赖于其级别 (在菜单结构中嵌套深度) 。
MenuItemStyleCollectionEditor例如,通过在视觉设计器 的属性网格的 LevelMenuItemStyles 或 LevelSelectedStyles 行上选择省略号按钮 (...) 调用。
该方法 CanSelectMultipleInstances 始终返回 false 以指示在编辑器中一次只能选择一个对象。 该方法 CreateCollectionForm 将创建一个新窗体来显示和编辑当前 MenuItemStyleCollection窗体。
该方法 CreateInstance 创建指定集合项类型的新实例。 该方法 CreateNewItemTypes 返回编辑器可以创建的类型的数组。
构造函数
| MenuItemStyleCollectionEditor(Type) | 初始化 MenuItemStyleCollectionEditor 类的新实例。 | 
属性
| CollectionItemType | 获取集合中每项的数据类型。(继承自 CollectionEditor) | 
| CollectionType | 获取集合对象的数据类型。(继承自 CollectionEditor) | 
| Context | 获取指示当前上下文的类型说明符。(继承自 CollectionEditor) | 
| HelpTopic | 在用户按下编辑器对话框中的“帮助”按钮或 F1 键时,获取“帮助”关键字以显示“帮助”主题或主题列表。(继承自 CollectionEditor) | 
| IsDropDownResizable | 获取一个值,该值指示是否应由用户调整下拉编辑器的大小。(继承自 UITypeEditor) | 
| NewItemTypes | 获取可为此集合创建的项的可用类型。(继承自 CollectionEditor) |