MenuItemCollectionEditor 类   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
public ref class MenuItemCollectionEditor : System::Drawing::Design::UITypeEditorpublic class MenuItemCollectionEditor : System.Drawing.Design.UITypeEditortype MenuItemCollectionEditor = class
    inherit UITypeEditorPublic Class MenuItemCollectionEditor
Inherits UITypeEditor- 继承
示例
下面的代码示例演示如何使用EditorAttribute特性将集合编辑器基类与从WebControl该类派生的自定义控件中的属性关联MenuItemCollectionEditor和UITypeEditor (集合编辑器基类) 类MenuItemCollection。
private MenuItemCollection menuItems;
// Associate the MenuItemCollectionEditor with the Items. 
[Editor(typeof(System.Web.UI.Design.WebControls.
    MenuItemCollectionEditor),
    typeof(UITypeEditor))]
public MenuItemCollection Items
{
    get
    {
        // If there is no menuItems collection, create it.
        if (menuItems == null)
            menuItems = new MenuItemCollection();
        return menuItems;
    }
    set { menuItems = value; }
} // Items
Private menuItems As MenuItemCollection
' Associate the MenuItemCollectionEditor with the Items.
<EditorAttribute( GetType(System.Web.UI.Design.WebControls. _
    MenuItemCollectionEditor), _
    GetType(UITypeEditor))> _
Public Property Items() As MenuItemCollection
    Get
        If menuItems Is Nothing Then
            menuItems = New MenuItemCollection()
        End If
        Return menuItems
    End Get
    Set
        menuItems = value
    End Set
End Property ' Items
注解
该MenuItemCollectionEditor类提供一个用户界面,用于编辑MenuItem由关联Menu控件中的属性指定的Items集合元素。
MenuItemCollectionEditor通过选择视觉设计器 的“属性” 网格中的 “项”属性上的省略号 (...) 按钮,或从控件上的 “常见任务”上下文菜单中选择 “编辑菜单项”来调用该省略号。
该方法 EditValue 编辑关联 Menu 控件的菜单项集合的值。 该方法 GetEditStyle 获取与此编辑器关联的编辑样式。
构造函数
| MenuItemCollectionEditor() | 初始化 MenuItemCollectionEditor 类的新实例。 | 
属性
| IsDropDownResizable | 获取一个值,该值指示是否应由用户调整下拉编辑器的大小。(继承自 UITypeEditor) | 
方法
| EditValue(IServiceProvider, Object) | 使用 GetEditStyle() 方法所指示的编辑器样式编辑指定对象的值。(继承自 UITypeEditor) | 
| EditValue(ITypeDescriptorContext, IServiceProvider, Object) | 编辑关联控件的菜单项集合的值。 | 
| Equals(Object) | 确定指定对象是否等于当前对象。(继承自 Object) | 
| GetEditStyle() | 获取由 EditValue(IServiceProvider, Object) 方法使用的编辑器样式。(继承自 UITypeEditor) | 
| GetEditStyle(ITypeDescriptorContext) | 获取与此编辑器关联的编辑样式。 | 
| GetHashCode() | 作为默认哈希函数。(继承自 Object) | 
| GetPaintValueSupported() | 指示该编辑器是否支持绘制对象值的表示形式。(继承自 UITypeEditor) | 
| GetPaintValueSupported(ITypeDescriptorContext) | 指示指定的上下文是否支持在指定的上下文内绘制对象值的表示形式。(继承自 UITypeEditor) | 
| GetType() | 获取当前实例的 Type。(继承自 Object) | 
| MemberwiseClone() | 创建当前 Object 的浅表副本。(继承自 Object) | 
| PaintValue(Object, Graphics, Rectangle) | 将指定对象值表示形式绘制到指定的画布上。(继承自 UITypeEditor) | 
| PaintValue(PaintValueEventArgs) | 使用指定的 PaintValueEventArgs 绘制某个对象的值的表示形式。(继承自 UITypeEditor) | 
| ToString() | 返回表示当前对象的字符串。(继承自 Object) |