ListItemCollection.Count Eigenschap

Definitie

Hiermee haalt u het aantal ListItem objecten in de verzameling op.

public:
 property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer

Waarde van eigenschap

Het aantal ListItem objecten in de verzameling.

Implementeringen

Voorbeelden

Als u de volgende code in een volledig werkend voorbeeld wilt weergeven, raadpleegt u het ListItemCollection klasonderwerp.

// Set the number of rows displayed in the ListBox to be
// the number of items in the ListBoxCollection.
ListBox1.Rows = ListBox1.Items.Count;
' Set the number of rows displayed in the ListBox to be
' the number of items in the ListBoxCollection.
ListBox1.Rows = ListBox1.Items.Count

Opmerkingen

Gebruik de Count eigenschap om het aantal ListItem objecten in de ListItemCollectioneigenschap te bepalen. De Count eigenschap wordt vaak gebruikt bij het doorlopen van de verzameling om de bovengrens van de verzameling te bepalen.

Van toepassing op

Zie ook