Export (0) Print
Expand All

ListView.HotTracking Property

Gets or sets a value indicating whether the text of an item or subitem has the appearance of a hyperlink when the mouse pointer passes over it.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public bool HotTracking { get; set; }
/** @property */
public boolean get_HotTracking ()

/** @property */
public void set_HotTracking (boolean value)

public function get HotTracking () : boolean

public function set HotTracking (value : boolean)

Not applicable.

Property Value

true if the item text has the appearance of a hyperlink when the mouse passes over it; otherwise, false. The default is false.

Enabling hot tracking willcause the Activation property to be set to OneClick andtheHoverSelection property to be set to true. In addition, run-time label editing is not allowed when hot tracking is enabled.

The following code example demonstrates a ListView with hot tracking enabled. To run this example, paste the following code into a Windows Form and call the InitializeHotTrackingListView method from the form's constructor or Load event handler.

private ImageList list = new ImageList();
private ListView hotTrackinglistView = new ListView();

private void InitializeHotTrackingListView(){
    list.Images.Add(new Bitmap(typeof(Button), "Button.bmp"));
    hotTrackinglistView.SmallImageList = list;
    hotTrackinglistView.Location = new Point(20, 20);
    hotTrackinglistView.View = View.SmallIcon;
    ListViewItem listItem1 = new ListViewItem("Short", 0 );
    ListViewItem listItem2 = new ListViewItem("Tiny", 0);
    hotTrackinglistView.Items.Add(listItem1);
    hotTrackinglistView.Items.Add(listItem2);
    hotTrackinglistView.HotTracking = true;
    this.Controls.Add(hotTrackinglistView);
}

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

Community Additions

ADD
Show:
© 2014 Microsoft