ListViewItem.Focused 屬性

定義

取得或設定值,指出 ListView 控制項中的項目是否具有焦點。

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

屬性值

Boolean

如果項目擁有焦點,則為 true,否則為 false

屬性

備註

ListView因為控制項沒有直接可編輯的區域 , 只有 包含的專案 ListView 可以編輯 - 中的 ListView 專案文字會在 焦點時 ListView 顯示焦點回音。 一般而言,控制項中 ListView 最後選取的專案是具有焦點的專案。 雖然專案可能會顯示焦點 Reticle,但它可能不是 中 ListView 選取的專案。 您可以使用 Focused 屬性來判斷專案目前是否為包含該專案的 ListView 控制項中焦點專案。 ListViewItem如果 與 控制項沒有關聯 ListView ,這個屬性會傳回 false

控制項 ListView 提供 FocusedItem 屬性,讓您判斷 中的 ListView 哪個 ListViewItem 具有焦點。

適用於

另請參閱