ListView.FocusedItem Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the item in the control that currently has focus.
public:
property System::Windows::Forms::ListViewItem ^ FocusedItem { System::Windows::Forms::ListViewItem ^ get(); };
public:
property System::Windows::Forms::ListViewItem ^ FocusedItem { System::Windows::Forms::ListViewItem ^ get(); void set(System::Windows::Forms::ListViewItem ^ value); };
[System.ComponentModel.Browsable(false)]
public System.Windows.Forms.ListViewItem FocusedItem { get; }
[System.ComponentModel.Browsable(false)]
public System.Windows.Forms.ListViewItem FocusedItem { get; set; }
[System.ComponentModel.Browsable(false)]
public System.Windows.Forms.ListViewItem? FocusedItem { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.FocusedItem : System.Windows.Forms.ListViewItem
[<System.ComponentModel.Browsable(false)>]
member this.FocusedItem : System.Windows.Forms.ListViewItem with get, set
Public ReadOnly Property FocusedItem As ListViewItem
Public Property FocusedItem As ListViewItem
Property Value
A ListViewItem that represents the item that has focus, or null
if no item has the focus in the ListView.
- Attributes
Remarks
The FocusedItem property returns the ListViewItem that represents the item currently displaying the focus rectangle for the ListView control. Because a ListView control has no directly editable areas other than the items it displays, when the ListView control has focus, an item within the ListView displays the focus reticle around its item text. Typically, the last selected item in the ListView control is the item with focus. Although an item may be the one displaying the focus reticle, it may not actually be a selected item in the ListView. Use the SelectedItems or SelectedIndices properties to obtain the selected items in the ListView control, the FocusedItem property is not necessarily selected. You can use the FocusedItem property to determine which item was last clicked in the ListView control, regardless of selection state.
Applies to
See also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈