ListItemCollection.Count Egenskap
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
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.