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)

'Declaration
Public Property HotTracking As Boolean

Property Value

Type: System.Boolean
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 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.

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 list As New ImageList()
Private hotTrackinglistView As New ListView()


Private Sub InitializeHotTrackingListView()
    list.Images.Add(New Bitmap(GetType(Button), "Button.bmp"))
    hotTrackinglistView.SmallImageList = list
    hotTrackinglistView.Location = New Point(20, 20)
    hotTrackinglistView.View = View.SmallIcon
    Dim listItem1 As New ListViewItem("Short", 0)
    Dim listItem2 As New ListViewItem("Tiny", 0)
    hotTrackinglistView.Items.Add(listItem1)
    hotTrackinglistView.Items.Add(listItem2)
    hotTrackinglistView.HotTracking = True 
    Me.Controls.Add(hotTrackinglistView)

End Sub

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft