Gets an array of descriptions of events.
[Visual Basic] Overridable Public Property All As EventDescriptor () [C#] public EventDescriptor[] All {virtual get; virtual set;} [C++] public: __property virtual EventDescriptor* get_All(); public: __property virtual void set_All(EventDescriptor*[]); [JScript] public function get All() : EventDescriptor[]; public function set All(EventDescriptor[]);
An array of type EventDescriptor with descriptions of the events.
Exception Type | Condition |
---|---|
NotSupportedException | Setting the property. |
This property is read-only. To set its value, you must inherit from this class.
The following example shows how to get an array of type EventDescriptor using the All property. It assumes that Button1 has been instantiated on a form.
[Visual Basic]
Private Sub GetAllEvents() ' Create a new collection and assign it the events for Button1. Dim events As EventDescriptorCollection events = TypeDescriptor.GetEvents(Button1) ' Get all the EventDescriptors. Dim eArray() As EventDescriptor eArray = events.All ' Print all the event names in a text box. Dim i As Integer For i = 0 To eArray.Length - 1 TextBox1.Text &= " " & eArray(i).Name Next End Sub
EventDescriptorCollection Class | EventDescriptorCollection Members | System.ComponentModel Namespace | EventDescriptor | TypeDescriptor