-
Apr 19th, 2021, 12:07 PM
#1
Thread Starter
Lively Member
Listview tooltip not showing
I want to show a tooltip on my listview. I implemented the code. Its called correctly however no Tooltip is shown.
Code:
ListView1.ShowItemToolTips = True
Private Sub ListView1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseMove
Dim thisItem As ListViewItem = ListView1.GetItemAt(e.X, e.Y)
If Not IsNothing(thisItem) Then
ToolTip1.SetToolTip(ListView1, thisItem.Text)
Else
ToolTip1.RemoveAll()
End If
End Sub
Private Sub ListView1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.MouseLeave
ToolTip1.RemoveAll()
End Sub
-
Apr 19th, 2021, 12:35 PM
#2
Re: Listview tooltip not showing
This worked for me,
Code:
' ListView1.ShowItemToolTips = True
Private Sub ListView1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseMove
Dim thisItem As ListViewItem = ListView1.GetItemAt(e.X, e.Y)
If Not IsNothing(thisItem) Then
thisItem.ToolTipText = DateTime.Now.ToString 'for testing
End If
End Sub
Private Sub ListView1_MouseLeave(sender As Object, e As EventArgs) Handles ListView1.MouseLeave
End Sub
-
Apr 19th, 2021, 12:40 PM
#3
Thread Starter
Lively Member
Re: Listview tooltip not showing
That works for me too, except I want the tooltip when I hover over Subitem(1)
-
Apr 20th, 2021, 09:57 AM
#4
Re: Listview tooltip not showing
I'm not aware of this capability for SubItems. Sorry.
-
Apr 20th, 2021, 11:06 AM
#5
Re: Listview tooltip not showing
The best friend of any programmer is a search engine
"Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
“They did not know it was impossible so they did it” (Mark Twain)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|