The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
AttributeCollection::GetEnumerator Method ()
.NET Framework (current version)
Gets an enumerator for this collection.
Assembly: System (in System.dll)
The following code example gets an enumerator for the attributes on button1. It uses the enumerator to print the names of the attributes in the collection. It assumes that button1 and textBox1 have been created on a form.
private: void MyEnumerator() { // Creates a new collection and assigns it the attributes for button1. AttributeCollection^ attributes; attributes = TypeDescriptor::GetAttributes( button1 ); // Creates an enumerator for the collection. System::Collections::IEnumerator^ ie = attributes->GetEnumerator(); // Prints the type of each attribute in the collection. Object^ myAttribute; System::Text::StringBuilder^ text = gcnew System::Text::StringBuilder; while ( ie->MoveNext() == true ) { myAttribute = ie->Current; text->Append( myAttribute ); text->Append( '\n' ); } textBox1->Text = text->ToString(); }
.NET Framework
Available since 1.1
Available since 1.1
Show: