MenuItemStyleCollectionEditor クラス
アセンブリ: System.Design (system.design.dll 内)


MenuItemStyleCollectionEditor クラスは、MenuDesigner オブジェクトの制御下で、デザイン時に、関連する Menu コントロール内の MenuItemStyleCollection オブジェクトの MenuItemStyle 要素を編集するためのユーザー インターフェイスを提供します。
Menu コントロールの LevelMenuItemStyles および LevelSelectedStyles の各プロパティに関連付けられた MenuItemStyleCollection があります。これらの MenuItemStyleCollection オブジェクトは、メニュー構造のレベル (入れ子の深さ) に依存するメニュー項目にスタイルを適用するために使用されます。
たとえば、ビジュアル デザイナの [プロパティ] グリッドの [LevelMenuItemStyles] 行または [LevelSelectedStyles] 行にある省略記号ボタン ([...]) をクリックすると、MenuItemStyleCollectionEditor が呼び出されます。
CanSelectMultipleInstances メソッドは、常に false を返し、エディタではオブジェクトを同時に 1 つしか選択できないことを示します。CreateCollectionForm メソッドは、新しいフォームを作成し、現在の MenuItemStyleCollection を編集します。
CreateInstance メソッドは、指定したコレクション項目の型の新しいインスタンスを作成します。CreateNewItemTypes メソッドは、エディタが作成できる型の配列を返します。

EditorAttribute 属性を使用し、MenuItemStyleCollectionEditor クラスおよび UITypeEditor クラス (コレクション エディタの基本クラス) を WebControl クラスから派生したカスタム コントロールのプロパティに関連付けるコード例を次に示します。これにより、MenuItemStyleCollection コレクションが取得および設定されます。
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
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

System.Drawing.Design.UITypeEditor
System.ComponentModel.Design.CollectionEditor
System.Web.UI.Design.WebControls.MenuItemStyleCollectionEditor


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- MenuItemStyleCollectionEditor クラスのページへのリンク