ListView.HotTracking Property

Definition

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.

C#
public bool HotTracking { get; set; }

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.

Examples

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.

C#
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);
}

Remarks

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

Applies to

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10