Gets an enumerator for this EventDescriptorCollection.
[Visual Basic] Public Function GetEnumerator() As IEnumerator [C#] public IEnumerator GetEnumerator(); [C++] public: 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 events As EventDescriptorCollection events = TypeDescriptor.GetEvents(Button1) ' Create an enumerator Dim ie As IEnumerator ie = events.GetEnumerator ' Print the name of each Event in the collecction. Dim myEvent As Object Do While ie.MoveNext = True myEvent = ie.Current TextBox1.Text &= " " & myEvent.ToString Loop End Sub
EventDescriptorCollection Class | EventDescriptorCollection Members | System.ComponentModel Namespace | EventDescriptor | TypeDescriptor | IEnumerator