Results 1 to 5 of 5

Thread: Listview tooltip not showing

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2021
    Posts
    71

    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

  2. #2
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,754

    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
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2021
    Posts
    71

    Re: Listview tooltip not showing

    That works for me too, except I want the tooltip when I hover over Subitem(1)

  4. #4
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,754

    Re: Listview tooltip not showing

    I'm not aware of this capability for SubItems. Sorry.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  5. #5
    Fanatic Member Delaney's Avatar
    Join Date
    Nov 2019
    Location
    Paris, France
    Posts
    845

    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
  •  



Click Here to Expand Forum to Full Width