[To be supplied.]
[C#] In C#, this member is the indexer for the EventDescriptorCollection class.
Gets the event with the specified name.
[Visual Basic] Overloads Overridable Public Default ReadOnly Property Item(String) As EventDescriptor
[C#] public EventDescriptor this[String] {virtual get;}
[C++] public: __property virtual EventDescriptor* get_Item(String*);
[JScript] EventDescriptorCollection.Item (String)
Gets the event with the specified index number.
[Visual Basic] Overloads Overridable Public Default ReadOnly Property Item(Integer) As EventDescriptor
[C#] public EventDescriptor this[int] {virtual get;}
[C++] public: __property virtual EventDescriptor* get_Item(int);
[JScript] EventDescriptorCollection.Item (int)
The following example uses the Item property (EventDescriptorCollection indexer) to print the name of the EventDescriptor specified by the index number in a text box. Since the index number is zero-based, this example prints the name of the second EventDescriptor. It assumes Button1 has been instantiated on a form.
Note This example shows how to use one of the overloaded versions of the Item property (EventDescriptorCollection indexer). For other examples that may be available, see the individual overload topics.
[Visual Basic]
Private Sub PrintIndexItem() Dim events As EventDescriptorCollection events = TypeDescriptor.GetEvents(Button1) ' Print the second event's name. TextBox1.Text = events.Item(1).Name End Sub
EventDescriptorCollection Class | EventDescriptorCollection Members | System.ComponentModel Namespace