Returns an integer containing the number of objects in a collection. Read-only.
Overridable Public ReadOnly Property Count() As Integer
This example uses the Collection object's Count property to specify how many iterations are required to remove all the elements of the collection called
Classes1. When collections are numerically indexed, the base is 1 by default. Since collections are reindexed automatically when a removal is made, the following code removes the first member on each iteration.
Dim Num As Long Dim Classes1 As New Collection() For Num = 1 To Classes1.Count ' Remove name from the collection. Classes1.Remove(1) ' Default collection numeric indexes. Next
Assembly: Microsoft Visual Basic .NET Runtime (in Microsoft.VisualBasic.dll)