SubMenuStyleCollectionEditor クラス
アセンブリ: System.Design (system.design.dll 内)
構文
解説SubMenuStyleCollectionEditor クラスは、MenuDesigner オブジェクトの制御下で、デザイン時に、関連する Menu コントロール内の SubMenuStyleCollection オブジェクトの SubMenuStyle 要素を編集するためのユーザー インターフェイスを提供します。
Menu コントロールの LevelSubMenuStyles プロパティに関連付けられた SubMenuStyleCollection があります。SubMenuStyleCollection オブジェクトは、メニュー構造のレベル (入れ子の深さ) に依存する静的なサブメニュー項目にスタイルを適用するために使用されます。
たとえば、ビジュアル デザイナの [プロパティ] グリッドの [LevelSubMenuStyles] 行にある省略記号ボタン ([...]) をクリックすると、SubMenuStyleCollectionEditor が呼び出されます。
CanSelectMultipleInstances メソッドは、常に false を返し、エディタではオブジェクトを同時に 1 つしか選択できないことを示します。CreateCollectionForm メソッドは、新しいフォームを作成し、SubMenuStyleCollection を編集します。
CreateInstance メソッドは、指定したコレクション項目の型の新しいインスタンスを作成します。CreateNewItemTypes メソッドは、エディタが作成できる型の配列を返します。
使用例EditorAttribute 属性を使用し、SubMenuStyleCollectionEditor クラスおよび UITypeEditor クラス (コレクション エディタの基本クラス) を WebControl クラスから派生したカスタム コントロールのプロパティに関連付けるコード例を次に示します。これにより、SubMenuStyleCollection コレクションが取得および設定されます。
Private subMenuStyles As SubMenuStyleCollection ' Associate the SubMenuStyleCollectionEditor with the ' LevelSubMenuStyles. <EditorAttribute( GetType(System.Web.UI.Design.WebControls. _ SubMenuStyleCollectionEditor), _ GetType(UITypeEditor))> _ Public Property LevelSubMenuStyles() As SubMenuStyleCollection Get Return subMenuStyles End Get Set subMenuStyles = value End Set End Property ' LevelSubMenuStyles
private SubMenuStyleCollection subMenuStyles; // Associate the SubMenuStyleCollectionEditor with the // LevelSubMenuStyles. [Editor(typeof(System.Web.UI.Design.WebControls. SubMenuStyleCollectionEditor), typeof(UITypeEditor))] public SubMenuStyleCollection LevelSubMenuStyles { get { return subMenuStyles; } set { subMenuStyles = value; } } // LevelSubMenuStyles
継承階層System.Drawing.Design.UITypeEditor
System.ComponentModel.Design.CollectionEditor
System.Web.UI.Design.WebControls.SubMenuStyleCollectionEditor
スレッド セーフ
プラットフォーム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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照- SubMenuStyleCollectionEditor クラスのページへのリンク