ListBox.SelectedIndexCollection.Contains(Int32) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
指定したインデックスがコレクション内にあるかどうかを判断します。
public:
bool Contains(int selectedIndex);
public bool Contains(int selectedIndex);
member this.Contains : int -> bool
Public Function Contains (selectedIndex As Integer) As Boolean
パラメーター
- selectedIndex
- Int32
コレクション内で検索するインデックス。
返品
注釈
Contains メソッドを使用すると、ListBox.ObjectCollection クラスからのインデックス位置が、ListBox.SelectedIndexCollectionに格納されている選択したインデックスのメンバーであるかどうかを判断できます。 これを使用して、複数選択 ListBox 内の特定の項目が選択されているかどうかを判断できます。