Gets an enumerator for this PropertyDescriptorCollection.
[Visual Basic] Overridable Public Function GetEnumerator() As IEnumerator [C#] public virtual IEnumerator GetEnumerator(); [C++] public: virtual IEnumerator* GetEnumerator(); [JScript] public function GetEnumerator() : IEnumerator;
An enumerator of type IEnumerator.
The following example gets an enumerator for the events on Button1. It uses the enumerator to print the names of the events in the collection. It assumes that Button1 has been instantiated on a form.
[Visual Basic]
Private Sub MyEnumerator() Dim properties As PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(Button1) ' Create an enumerator Dim ie As IEnumerator ie = properties.GetEnumerator ' Print the name of each property in the collecction. Dim myProperty As Object Do While ie.MoveNext = True myProperty = ie.Current TextBox1.Text &= " " & myProperty.ToString Loop End Sub
PropertyDescriptorCollection Class | PropertyDescriptorCollection Members | System.ComponentModel Namespace | PropertyDescriptor | TypeDescriptor | IEnumerator