語言

MenuBindingsEditor 類別

定義

提供元件編輯器以收集 DataBindings 相關 Menu 控制項。

public ref class MenuBindingsEditor : System::Drawing::Design::UITypeEditor
public class MenuBindingsEditor : System.Drawing.Design.UITypeEditor
type MenuBindingsEditor = class
    inherit UITypeEditor
Public Class MenuBindingsEditor
Inherits UITypeEditor
繼承
MenuBindingsEditor

範例

以下程式碼範例展示了如何利用屬性EditorAttribute將類別與MenuBindingsEditor類別(綁定編輯器基底類別)關聯UITypeEditor到一個屬性,該屬性由WebControl類別衍生,該控制項會取得並設定一個MenuItemCollection集合。

private MenuItemBindingCollection localBindings;

// Associate the MenuBindingsEditor with the DataBindings. 
[Editor(typeof(System.Web.UI.Design.WebControls.MenuBindingsEditor),
    typeof(UITypeEditor))]
public MenuItemBindingCollection DataBindings
{
    get { return localBindings; }
    set { localBindings = value; }
} // DataBindings
Private localBindings As MenuItemBindingCollection

' Associate the MenuBindingsEditor with the DataBindings.
<EditorAttribute( GetType(System.Web.UI.Design.WebControls. _
    MenuBindingsEditor), _
    GetType(UITypeEditor))> _
Public Property DataBindings() As MenuItemBindingCollection
    Get
        Return localBindings
    End Get
    Set
        localBindings = value
    End Set
End Property ' DataBindings

備註

該MenuBindingsEditor類別提供使用者介面,方便在相關MenuItemBinding控制項內編輯DataBindings集合元素Menu。

MenuBindingsEditor物件可透過視覺設計器屬性網格中 DataBindings 屬性中的省略號(...)按鈕,或在控制鍵的常用任務右鍵中選擇「編輯選單項目」來呼叫。

該 EditValue 方法會編輯相關 Menu 控制項的資料綁定集合的值。 此 GetEditStyle 方法會取得與此編輯器相關的編輯風格。

建構函式

名稱 Description
MenuBindingsEditor()

初始化 MenuBindingsEditor 類別的新執行個體。

屬性

名稱 Description
IsDropDownResizable

會有一個值,指示下拉選單編輯器是否應該被使用者調整大小。

(繼承來源 UITypeEditor)

方法

名稱 Description
EditValue(IServiceProvider, Object)

使用方法指示 GetEditStyle() 的編輯器樣式編輯指定物件的值。

(繼承來源 UITypeEditor)
EditValue(ITypeDescriptorContext, IServiceProvider, Object)

編輯相關 Menu 控制項的資料綁定集合值。

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)

適用於

另請參閱