ListItemCollection.Count 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得集合中的物件數量 ListItem 。
public:
property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer
屬性值
收藏中的物件數量 ListItem 。
實作
範例
若要完整檢視以下程式碼,請參閱 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
備註
利用該Count性質來決定 中ListItem物件ListItemCollection的數量。 此 Count 性質常用於遍歷集合以確定集合的上界。