Results 1 to 5 of 5

Thread: multiline tool tip

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,586

    multiline tool tip

    why the code dont show a multiline tool tip?

    instead if the label is on the form the code work fine!
    Attached Files Attached Files

  2. #2
    Fanatic Member
    Join Date
    Jul 2007
    Location
    Essex, UK.
    Posts
    578

    Re: multiline tool tip

    Because a label is not a 'Windowed' control and doesn't have a HWND, you must set the tooltip HWND to the parent of the label. In your case this is Picture1.

    Code:
    Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Not m_bInLable Then
            m_bInLable = True
            TT.Title = "Multiline tooltip"
            TT.TipText = "Label1"
            TT.Create Picture1.hwnd
        End If
    End Sub

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,586

    Re: multiline tool tip

    Quote Originally Posted by Steve Grant View Post
    Because a label is not a 'Windowed' control and doesn't have a HWND, you must set the tooltip HWND to the parent of the label. In your case this is Picture1.

    Code:
    Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Not m_bInLable Then
            m_bInLable = True
            TT.Title = "Multiline tooltip"
            TT.TipText = "Label1"
            TT.Create Picture1.hwnd
        End If
    End Sub
    great! work!
    .... uhmmm..

    how to check when the mouse is out of the area of label1?

    in this case i need to set nothing the tooltip multiline, whit:

    If m_bInLable Then
    m_bInLable = False
    TT.Destroy
    End If

  4. #4
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,904

    Re: multiline tool tip

    When the mouse moves over Picture1 set m_bInLable to False

  5. #5
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: multiline tool tip

    I have a few projects for multiline tooltips.
    This one is for windowless controls (eg a Label) -
    https://www.freevbcode.com/ShowCode.asp?ID=5765
    Yell out if it aint what you need (as I may have other windowless ones stashed away)
    Rob

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