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属性确定 . ListItemCollection中的对象数ListItem。 在 Count 循环访问集合以确定集合的上限时,通常使用该属性。