Re: Adding A Tooltip To A ListView Item
From: Herfried K. Wagner [MVP] (hirf-spam-me-here_at_gmx.at)
Date: 06/09/04
- Next message: SStory: "Re: vb.net using a .cs class"
- Previous message: Herfried K. Wagner [MVP]: "Re: vb.net using a .cs class"
- In reply to: Dino Buljubasic: "Adding A Tooltip To A ListView Item"
- Messages sorted by: [ date ] [ thread ]
Date: 10 Jun 2004 00:08:51 +0200
* Dino Buljubasic <dino@noplacelikehome.com> scripsit:
> Is it possible to add tooltip to a listview item?
Set the items' 'Tag' property to the tooltip text and add a ToolTip
component to the form. Then add this code:
\\\
Private m_HoveredItem As ListViewItem
Private Sub ListView1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseMove
Dim lvi As ListViewItem = Me.ListView1.GetItemAt(e.X, e.Y)
If Not lvi Is m_HoveredItem Then
m_HoveredItem = lvi
If lvi Is Nothing Then
Me.ToolTip1.SetToolTip(Me.ListView1, "")
Else
Me.ToolTip1.SetToolTip(Me.ListView1, lvi.Tag)
End If
End If
End Sub
///
The code is untested, but it should basically work. If you find any
problems with the code, please let me know.
-- Herfried K. Wagner [MVP] <URL:http://dotnet.mvps.org/>
- Next message: SStory: "Re: vb.net using a .cs class"
- Previous message: Herfried K. Wagner [MVP]: "Re: vb.net using a .cs class"
- In reply to: Dino Buljubasic: "Adding A Tooltip To A ListView Item"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|