PropertyDescriptorCollection::Count Property
.NET Framework (current version)
Gets the number of property descriptors in the collection.
Assembly: System (in System.dll)
You can use the Count property to set the limits of a loop that iterates through a collection of objects. Because the collection is zero-based, be sure to use Count - 1 as the upper boundary of the loop.
The following code example uses the Count property to print the number of properties on button1. It requires that button1 and textBox1 have been instantiated on a form.
.NET Framework
Available since 1.1
Available since 1.1
Show: