Export (0) Print
Expand All

ListView.FocusedItem Property

Gets the item in the control that currently has focus.

[Visual Basic]
Public ReadOnly Property FocusedItem As ListViewItem
public ListViewItem FocusedItem {get;}
public: __property ListViewItem* get_FocusedItem();
public function get FocusedItem() : ListViewItem;

Property Value

A ListViewItem that represents the item that has focus. If no item has the focus in the ListView control, a null reference (Nothing in Visual Basic) is returned.


The FocusedItem property returns the ListViewItem representing the item that is currently displaying the focus reticle 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 focused item. 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 item(s) 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.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

ListView Class | ListView Members | System.Windows.Forms Namespace | ListViewItem

© 2015 Microsoft