This documentation is archived and is not being maintained.

ComponentDesigner.InvokeGetInheritanceAttribute Method

Gets the InheritanceAttribute of the specified ComponentDesigner.

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

Parameters

toInvoke
The ComponentDesigner whose inheritance attribute to retrieve.

Return Value

The InheritanceAttribute of the specified designer.

Example

[Visual Basic] 
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] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

ComponentDesigner Class | ComponentDesigner Members | System.ComponentModel.Design Namespace

Show: