次の方法で共有


ComponentDesigner.InvokeGetInheritanceAttribute メソッド

指定した ComponentDesignerInheritanceAttribute を取得します。

Protected Function InvokeGetInheritanceAttribute( _
   ByVal toInvoke As ComponentDesigner _) As InheritanceAttribute
[C#]
protected InheritanceAttribute InvokeGetInheritanceAttribute(ComponentDesignertoInvoke);
[C++]
protected: InheritanceAttribute* InvokeGetInheritanceAttribute(ComponentDesigner* toInvoke);
[JScript]
protected function InvokeGetInheritanceAttribute(
   toInvoke : ComponentDesigner) : InheritanceAttribute;

パラメータ

戻り値

指定したデザイナの InheritanceAttribute

使用例

 
Public Class DesignerSample
   Inherits ComponentDesigner
   
   Public Overrides ReadOnly Property Verbs() As DesignerVerbCollection
      Get
         ' Specifies a new verb that will show up in the context menu for the component.
         Dim clickVerb As New DesignerVerb("Click Me!", New EventHandler(AddressOf OnVerbClicked))
         Return New DesignerVerbCollection(New DesignerVerb() {clickVerb})
      End Get
   End Property
   
   
   Private Sub OnVerbClicked(sender As Object, e As EventArgs)
      MessageBox.Show("This verb was clicked")
   End Sub 'OnVerbClicked
End Class 'DesignerSample
 . . . 
<Designer(GetType(DesignerSample))>  _
Public Class DesignerComponent
   Inherits Component
End Class 'DesignerComponent
 _

[C#] 
public class DesignerSample : ComponentDesigner
{
    public override DesignerVerbCollection Verbs 
    {
        get
        {
            // Specifies a new verb that will show up in the shortcut menu for the component.
            DesignerVerb clickVerb = new DesignerVerb("Click Me!", new EventHandler(OnVerbClicked));
            return new DesignerVerbCollection(new DesignerVerb[] {clickVerb});
        }
    }

    private void OnVerbClicked(object sender, EventArgs e) 
    {
        MessageBox.Show("This verb was clicked");
    }
}
    . . . 
[Designer(typeof(DesignerSample))]
public class DesignerComponent : Component
{
}

[C++] 
public __gc class DesignerSample : public ComponentDesigner {
public:

    __property DesignerVerbCollection* get_Verbs()
    {
        // Specifies a new verb that will show up in the shortcut menu for the component.
        DesignerVerb* clickVerb = new DesignerVerb(S"Click Me!", new EventHandler(this, &DesignerSample::OnVerbClicked));
        DesignerVerb* myArray[] = {clickVerb};
        return new DesignerVerbCollection(myArray);
    }

private:

    void OnVerbClicked(Object* /*sender*/, EventArgs* /*e*/)
    {
        MessageBox::Show(S"This verb was clicked");
    }
};
. . . 
[Designer(__typeof(DesignerSample))]
public __gc class DesignerComponent : public Component
{
};

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

.NET Framework セキュリティ:

参照

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