Export (0) Print
Expand All

AttributeCollection Constructor

Initializes a new instance of the AttributeCollection class.

[Visual Basic]
Public Sub New( _
   ByVal attributes() As Attribute _
)
[C#]
public AttributeCollection(
   Attribute[] attributes
);
[C++]
public: AttributeCollection(
   Attribute* attributes[]
);
[JScript]
public function AttributeCollection(
   attributes : Attribute[]
);

Parameters

attributes
An array of type Attribute that provides the attributes for this collection.

Example

The following example creates a new AttributeCollection using the attributes on button1. It assumes that button1 has been created on a form.

[Visual Basic] 
Dim collection1 As AttributeCollection
collection1 = TypeDescriptor.GetAttributes(button1)

[C#] 
AttributeCollection collection1;
collection1 = TypeDescriptor.GetAttributes(button1);
}

[C++] 
AttributeCollection*    collection1;
collection1 = TypeDescriptor::GetAttributes( button1 );

[JScript] 
var collection1 : AttributeCollection;
collection1 = TypeDescriptor.GetAttributes(button1);
textBox1.Text = "The button1 has " + collection1.Count + " attributes";
}

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 Compact Framework

See Also

AttributeCollection Class | AttributeCollection Members | System.ComponentModel Namespace | Attribute

Show:
© 2014 Microsoft