DesignerAttribute Class
Specifies the class used to implement design-time services for a component.
Assembly: System (in System.dll)
The class you use for the design-time services must implement the IDesigner interface.
Use the DesignerBaseTypeName property to find the designer's base type. Use the DesignerTypeName property to get the name of the type of designer associated with this member.
For more information, see Attributes Overview and Extending Metadata Using Attributes.
The following example creates a class called MyForm. MyForm has two attributes, a DesignerAttribute that specifies this class uses the DocumentDesigner, and a DesignerCategoryAttribute that specifies the Form category.
The next example creates an instance of MyForm. Then it gets the attributes for the class, extracts the DesignerAttribute, and prints the name of the designer.
Public Shared Function Main() As Integer ' Creates a new form. Dim myNewForm As New MyForm() ' Gets the attributes for the collection. Dim attributes As AttributeCollection = TypeDescriptor.GetAttributes(myNewForm) ' Prints the name of the designer by retrieving the DesignerAttribute ' from the AttributeCollection. Dim myAttribute As DesignerAttribute = _ CType(attributes(GetType(DesignerAttribute)), DesignerAttribute) Console.WriteLine(("The designer for this class is: " & myAttribute.DesignerTypeName)) Return 0 End Function 'Main
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.