DesignerVerb イベント
DesignerVerb クラス
アセンブリ: System (system.dll 内)


デザイナ動詞とは、イベント ハンドラにリンクされているメニュー コマンドのことです。デザイナ動詞は、デザイン時にコンポーネントのショートカット メニューに追加されます。また、Visual Studio では、LinkLabel を使用して、[プロパティ] ウィンドウの [説明] ペインに各デザイナ動詞がリストされます。
![]() |
---|
このクラスに適用される HostProtectionAttribute 属性の Resources プロパティの値は、SharedState です。HostProtectionAttribute は、デスクトップ アプリケーション (一般的には、アイコンをダブルクリック、コマンドを入力、またはブラウザに URL を入力して起動するアプリケーション) には影響しません。詳細については、HostProtectionAttribute クラスのトピックまたは「SQL Server プログラミングとホスト保護属性」を参照してください。 |

DesignerVerb オブジェクトを作成し、コンポーネントのデザイン時ショートカット メニューに追加するコード例を次に示します。
Imports System Imports System.ComponentModel Imports System.Collections Imports System.ComponentModel.Design ' This sample demonstrates a designer that adds menu commands ' to the design-time shortcut menu for a component. ' ' To test this sample, build the code for the component as a class library, ' add the resulting component to the toolbox, open a form in design mode, ' and drag the component from the toolbox onto the form. ' ' The component should appear in the component tray beneath the form. ' Right-click the component. The verbs should appear in the shortcut menu. Namespace VBDesignerVerb ' Associate MyDesigner with this component type using a DesignerAttribute <Designer(GetType(MyDesigner))> _ Public Class Component1 Inherits System.ComponentModel.Component End Class ' This is a designer class which provides designer verb menu commands for ' the associated component. This code is called by the design environment at design-time. Friend Class MyDesigner Inherits ComponentDesigner Private m_Verbs As DesignerVerbCollection ' DesignerVerbCollection is overridden from ComponentDesigner Public Overrides ReadOnly Property Verbs() As DesignerVerbCollection Get If m_Verbs Is Nothing Then ' Create and initialize the collection of verbs m_Verbs = New DesignerVerbCollection() m_Verbs.Add( New DesignerVerb("First Designer Verb", New EventHandler(AddressOf OnFirstItemSelected)) ) m_Verbs.Add( New DesignerVerb("Second Designer Verb", New EventHandler(AddressOf OnSecondItemSelected)) ) End If Return m_Verbs End Get End Property Sub New() End Sub Private Sub OnFirstItemSelected(ByVal sender As Object, ByVal args As EventArgs) ' Display a message System.Windows.Forms.MessageBox.Show("The first designer verb was invoked.") End Sub Private Sub OnSecondItemSelected(ByVal sender As Object, ByVal args As EventArgs) ' Display a message System.Windows.Forms.MessageBox.Show("The second designer verb was invoked.") End Sub End Class End Namespace
using System; using System.ComponentModel; using System.ComponentModel.Design; using System.Collections; /* This sample demonstrates a designer that adds menu commands to the design-time shortcut menu for a component. To test this sample, build the code for the component as a class library, add the resulting component to the toolbox, open a form in design mode, and drag the component from the toolbox onto the form. The component should appear in the component tray beneath the form. Right-click the component. The verbs should appear in the shortcut menu. */ namespace CSDesignerVerb { // Associate MyDesigner with this component type using a DesignerAttribute [Designer(typeof(MyDesigner))] public class Component1 : System.ComponentModel.Component { } // This is a designer class which provides designer verb menu commands for // the associated component. This code is called by the design environment at design-time. internal class MyDesigner : ComponentDesigner { DesignerVerbCollection m_Verbs; // DesignerVerbCollection is overridden from ComponentDesigner public override DesignerVerbCollection Verbs { get { if (m_Verbs == null) { // Create and initialize the collection of verbs m_Verbs = new DesignerVerbCollection(); m_Verbs.Add( new DesignerVerb("First Designer Verb", new EventHandler(OnFirstItemSelected)) ); m_Verbs.Add( new DesignerVerb("Second Designer Verb", new EventHandler(OnSecondItemSelected)) ); } return m_Verbs; } } MyDesigner() { } private void OnFirstItemSelected(object sender, EventArgs args) { // Display a message System.Windows.Forms.MessageBox.Show("The first designer verb was invoked."); } private void OnSecondItemSelected(object sender, EventArgs args) { // Display a message System.Windows.Forms.MessageBox.Show("The second designer verb was invoked."); } } }
#using <system.dll> #using <system.design.dll> #using <system.windows.forms.dll> using namespace System; using namespace System::ComponentModel; using namespace System::ComponentModel::Design; using namespace System::Windows::Forms; /* This sample demonstrates a designer that adds menu commands to the design-time shortcut menu for a component. To test this sample, build the code for the component as a class library, add the resulting component to the toolbox, open a form in design mode, and drag the component from the toolbox onto the form. The component should appear in the component tray beneath the form. Right-click the component. The verbs should appear in the shortcut menu. */ // This is a designer class which provides designer verb menu commands for // the associated component. This code is called by the design environment at design-time. private ref class MyDesigner: public ComponentDesigner { public: property DesignerVerbCollection^ Verbs { // DesignerVerbCollection is overridden from ComponentDesigner virtual DesignerVerbCollection^ get() override { if ( m_Verbs == nullptr ) { // Create and initialize the collection of verbs m_Verbs = gcnew DesignerVerbCollection; m_Verbs->Add( gcnew DesignerVerb( "First Designer Verb",gcnew EventHandler( this, &MyDesigner::OnFirstItemSelected ) ) ); m_Verbs->Add( gcnew DesignerVerb( "Second Designer Verb",gcnew EventHandler( this, &MyDesigner::OnSecondItemSelected ) ) ); } return m_Verbs; } } MyDesigner(){} private: DesignerVerbCollection^ m_Verbs; void OnFirstItemSelected( Object^ /*sender*/, EventArgs^ /*args*/ ) { // Display a message MessageBox::Show( "The first designer verb was invoked." ); } void OnSecondItemSelected( Object^ /*sender*/, EventArgs^ /*args*/ ) { // Display a message MessageBox::Show( "The second designer verb was invoked." ); } }; // Associate MyDesigner with this component type using a DesignerAttribute [Designer(MyDesigner::typeid)] public ref class Component1: public System::ComponentModel::Component{};


System.ComponentModel.Design.MenuCommand
System.ComponentModel.Design.DesignerVerb
System.Web.UI.Design.TemplateEditingVerb


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


DesignerVerb コンストラクタ (String, EventHandler)
アセンブリ: System (system.dll 内)




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


DesignerVerb コンストラクタ (String, EventHandler, CommandID)
アセンブリ: System (system.dll 内)

Dim text As String Dim handler As EventHandler Dim startCommandID As CommandID Dim instance As New DesignerVerb(text, handler, startCommandID)



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


DesignerVerb コンストラクタ

名前 | 説明 |
---|---|
DesignerVerb (String, EventHandler) | DesignerVerb クラスの新しいインスタンスを初期化します。 |
DesignerVerb (String, EventHandler, CommandID) | DesignerVerb クラスの新しいインスタンスを初期化します。 |

DesignerVerb プロパティ

名前 | 説明 | |
---|---|---|
![]() | Checked | メニュー項目がチェックされているかどうかを示す値を取得または設定します。 ( MenuCommand から継承されます。) |
![]() | CommandID | メニュー コマンドに関連付けられている CommandID を取得します。 ( MenuCommand から継承されます。) |
![]() | Description | 動詞に関するメニュー項目の説明を取得または設定します。 |
![]() | Enabled | メニュー項目を使用できるかどうかを示す値を取得します。 ( MenuCommand から継承されます。) |
![]() | OleStatus | メニュー項目の OLE コマンド ステータス コードを取得します。 ( MenuCommand から継承されます。) |
![]() | Properties | MenuCommand に関連付けられているパブリック プロパティを取得します。 ( MenuCommand から継承されます。) |
![]() | Supported | メニュー項目がサポートされているかどうかを示す値を取得または設定します。 ( MenuCommand から継承されます。) |
![]() | Text | メニュー上の動詞コマンドを説明するテキストを取得します。 |
![]() | Visible | メニュー項目を表示するかどうかを示す値を取得または設定します。 ( MenuCommand から継承されます。) |

DesignerVerb メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | Invoke | オーバーロードされます。 コマンドを呼び出します。 ( MenuCommand から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | オーバーライドされます。 ToString をオーバーライドします。 |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |
![]() | OnCommandChanged | CommandChanged イベントを発生させます。 ( MenuCommand から継承されます。) |

DesignerVerb メンバ
DesignerVerb データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | Checked | メニュー項目がチェックされているかどうかを示す値を取得または設定します。(MenuCommand から継承されます。) |
![]() | CommandID | メニュー コマンドに関連付けられている CommandID を取得します。(MenuCommand から継承されます。) |
![]() | Description | 動詞に関するメニュー項目の説明を取得または設定します。 |
![]() | Enabled | メニュー項目を使用できるかどうかを示す値を取得します。(MenuCommand から継承されます。) |
![]() | OleStatus | メニュー項目の OLE コマンド ステータス コードを取得します。(MenuCommand から継承されます。) |
![]() | Properties | MenuCommand に関連付けられているパブリック プロパティを取得します。(MenuCommand から継承されます。) |
![]() | Supported | メニュー項目がサポートされているかどうかを示す値を取得または設定します。(MenuCommand から継承されます。) |
![]() | Text | メニュー上の動詞コマンドを説明するテキストを取得します。 |
![]() | Visible | メニュー項目を表示するかどうかを示す値を取得または設定します。(MenuCommand から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | Invoke | オーバーロードされます。 コマンドを呼び出します。 (MenuCommand から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | オーバーライドされます。 ToString をオーバーライドします。 |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |
![]() | OnCommandChanged | CommandChanged イベントを発生させます。 (MenuCommand から継承されます。) |


Weblioに収録されているすべての辞書からDesignerVerbを検索する場合は、下記のリンクをクリックしてください。

- DesignerVerbのページへのリンク