ListBoxItem.IsSelected プロパティ

定義

ListBoxItemが選択されているかどうかを示す値を取得または設定します。

public:
 property bool IsSelected { bool get(); void set(bool value); };
[System.ComponentModel.Bindable(true)]
public bool IsSelected { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.IsSelected : bool with get, set
Public Property IsSelected As Boolean

プロパティ値

true 項目が選択されている場合。それ以外の場合は false。 既定値は false です。

属性

次の例は、リスト ボックスの作成時に選択するリスト ボックス項目を設定する方法を示しています。

<ListBoxItem Name="item0" IsSelected="true">Item 0</ListBoxItem>

注釈

ListBoxListBoxItemを選択するには、このプロパティを true に設定します。

依存関係プロパティ情報

品目 Value
識別子フィールド IsSelectedProperty
に設定されたメタデータ プロパティ true BindsTwoWayByDefault

適用対象