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
注釈
ListItemCollection内のListItem オブジェクトの数を決定するには、Count プロパティを使用します。 Count プロパティは、コレクションを反復処理してコレクションの上限を決定するときによく使用されます。