ListItemCollection.Count Vlastnost

Definice

Získá počet ListItem objektů v kolekci.

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

Hodnota vlastnosti

Počet ListItem objektů v kolekci.

Implementuje

Příklady

Pokud chcete zobrazit následující kód v plně funkčním příkladu, podívejte se na ListItemCollection téma třídy.

// 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

Poznámky

Count Pomocí vlastnosti určete počet ListItem objektů v objektu ListItemCollection. Vlastnost se Count běžně používá při iteraci kolekcí k určení horní hranice kolekce.

Platí pro

Viz také