EventDescriptorCollection::Count Property
Gets the number of event descriptors in the collection.
Assembly: System (in System.dll)
The Count property can be used to set the limits of a loop that iterates through a collection of objects. If the collection is zero-based, be sure to use Count - 1 as the upper boundary of the loop.
Note |
|---|
The HostProtectionAttribute attribute applied to this class has the following Resources property value: Synchronization. The HostProtectionAttribute does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the HostProtectionAttribute class or SQL Server Programming and Host Protection Attributes. |
The following code example uses the Count property to print the number of events attached to button1. It requires that button1 and textBox1 have been instantiated on a form.
Available since 1.1
