DesignerVerbとは? わかりやすく解説

DesignerVerb イベント


パブリック イベントパブリック イベント

  名前 説明
パブリック イベント CommandChanged  メニュー コマンド変更されたときに発生します。 ( MenuCommand から継承されます。)
参照参照

関連項目

DesignerVerb クラス
System.ComponentModel.Design 名前空間
MenuCommand
IMenuCommandService

DesignerVerb クラス

デザイナから呼び出すことができる動詞表します

名前空間: System.ComponentModel.Design
アセンブリ: System (system.dll 内)
構文構文

<ComVisibleAttribute(True)> _
Public Class DesignerVerb
    Inherits MenuCommand
[ComVisibleAttribute(true)] 
public class DesignerVerb : MenuCommand
[ComVisibleAttribute(true)] 
public ref class DesignerVerb : public
 MenuCommand
/** @attribute ComVisibleAttribute(true) */ 
public class DesignerVerb extends MenuCommand
ComVisibleAttribute(true) 
public class DesignerVerb extends
 MenuCommand
解説解説
使用例使用例

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{};
.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
   System.ComponentModel.Design.MenuCommand
    System.ComponentModel.Design.DesignerVerb
       System.Web.UI.Design.TemplateEditingVerb
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DesignerVerb メンバ
System.ComponentModel.Design 名前空間
MenuCommand
IMenuCommandService

DesignerVerb コンストラクタ (String, EventHandler)

DesignerVerb クラス新しインスタンス初期化します。

名前空間: System.ComponentModel.Design
アセンブリ: System (system.dll 内)
構文構文

解説解説
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DesignerVerb クラス
DesignerVerb メンバ
System.ComponentModel.Design 名前空間

DesignerVerb コンストラクタ (String, EventHandler, CommandID)

DesignerVerb クラス新しインスタンス初期化します。

名前空間: System.ComponentModel.Design
アセンブリ: System (system.dll 内)
構文構文

Public Sub New ( _
    text As String, _
    handler As EventHandler, _
    startCommandID As CommandID _
)
Dim text As String
Dim handler As EventHandler
Dim startCommandID As CommandID

Dim instance As New DesignerVerb(text,
 handler, startCommandID)
public DesignerVerb (
    string text,
    EventHandler handler,
    CommandID startCommandID
)
public:
DesignerVerb (
    String^ text, 
    EventHandler^ handler, 
    CommandID^ startCommandID
)
public DesignerVerb (
    String text, 
    EventHandler handler, 
    CommandID startCommandID
)
public function DesignerVerb (
    text : String, 
    handler : EventHandler, 
    startCommandID : CommandID
)

パラメータ

text

ユーザーに対して表示されるメニュー コマンドテキスト

handler

動詞アクション実行するイベント ハンドラ

startCommandID

動詞開始コマンド ID既定では、動詞コマンド ID範囲は、デザイナ アーキテクチャによって指定されます。カスタムコマンド ID指定することにより、この既定値オーバーライドできます

解説解説
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DesignerVerb クラス
DesignerVerb メンバ
System.ComponentModel.Design 名前空間

DesignerVerb コンストラクタ

DesignerVerb クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
DesignerVerb (String, EventHandler) DesignerVerb クラス新しインスタンス初期化します。
DesignerVerb (String, EventHandler, CommandID) DesignerVerb クラス新しインスタンス初期化します。
参照参照

関連項目

DesignerVerb クラス
DesignerVerb メンバ
System.ComponentModel.Design 名前空間

DesignerVerb プロパティ


パブリック プロパティパブリック プロパティ

参照参照

関連項目

DesignerVerb クラス
System.ComponentModel.Design 名前空間
MenuCommand
IMenuCommandService

DesignerVerb メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

DesignerVerb クラス
System.ComponentModel.Design 名前空間
MenuCommand
IMenuCommandService

DesignerVerb メンバ

デザイナから呼び出すことができる動詞表します

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


パブリック コンストラクタパブリック コンストラクタ
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
パブリック イベントパブリック イベント
  名前 説明
パブリック イベント CommandChanged  メニュー コマンド変更されたときに発生します。(MenuCommand から継承されます。)
参照参照

関連項目

DesignerVerb クラス
System.ComponentModel.Design 名前空間
MenuCommand
IMenuCommandService


このページでは「.NET Framework クラス ライブラリ リファレンス」からDesignerVerbを検索した結果を表示しています。
Weblioに収録されているすべての辞書からDesignerVerbを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からDesignerVerb を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DesignerVerb」の関連用語

DesignerVerbのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DesignerVerbのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS