ListItemCollection.Count Egenskap

Definition

Hämtar antalet ListItem objekt i samlingen.

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

Egenskapsvärde

Antalet ListItem objekt i samlingen.

Implementeringar

Exempel

Information om hur du visar följande kod i ett fullständigt fungerande exempel finns i klassavsnittet ListItemCollection .

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

Kommentarer

Använd egenskapen Count för att fastställa antalet ListItem objekt i ListItemCollection. Egenskapen Count används ofta när du itererar genom samlingen för att fastställa samlingens övre gräns.

Gäller för

Se även