ListView.FocusedItem Property

Gets or sets the item in the control that currently has focus.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in

public ListViewItem FocusedItem { get; set; }
/** @property */
public ListViewItem get_FocusedItem ()

/** @property */
public void set_FocusedItem (ListViewItem value)

public function get FocusedItem () : ListViewItem

public function set FocusedItem (value : ListViewItem)

Not applicable.

Property Value

A ListViewItem that represents the item that has focus, or a null reference (Nothing in Visual Basic) if no item has the focus in the ListView.

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.

Windows Mobile 2003 for Pocket PC, Windows Mobile 2003 for Smartphone, Windows CE Platform Note: For the .NET Compact Framework, this property is read-only.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0