次の方法で共有


ListBox.SelectedObjectCollection.Count プロパティ

コレクション内の項目の数を取得します。

Public Overridable ReadOnly Property Count As Integer  Implements _   ICollection.Count
[C#]
public virtual int Count {get;}
[C++]
public: __property virtual int get_Count();
[JScript]
public function get Count() : int;

プロパティ値

コレクション内の項目の数。

実装

ICollection.Count

解説

このプロパティを使用すると、 ListBox 内で選択されている項目の数を確認できます。この値は、コレクションの値をループするときに、ループの反復回数を指定する必要がある場合に使用できます。 ListBoxSelectionMode プロパティが SelectionMode.MultiSimple または SelectionMode.MultiExtended のいずれかに設定されていない限り、このプロパティは、選択されている項目があるかどうかに応じて常に 0 または 1 の値を返します。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

ListBox.SelectedObjectCollection クラス | ListBox.SelectedObjectCollection メンバ | System.Windows.Forms 名前空間