Results 1 to 10 of 10

Thread: Multi-line tooltips

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2000
    Location
    Sheffield, England.
    Posts
    136

    Unhappy

    I thought that by doing "Line 1" & Chr$(13) & "Line 2" etc, I might be able to generate multi-line tool tips, but it doesn't work.

    Any idea how this is possible? I've seen it before so I know it can be done.
    Visual Basic 6 Enterprise Edition + SP4

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Someone posted a question about this before on this forum, and never go an answer, as no one knew how to do it. I have tried and failed as well.
    Iain, thats with an i by the way!

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 2000
    Location
    Sheffield, England.
    Posts
    136
    Bugger.

    Visual Basic 6 Enterprise Edition + SP4

  4. #4
    Lively Member
    Join Date
    Mar 2000
    Posts
    81

    Angry No help...

    It's possible in VC but it's quite (very) complicated and relies on having version 4.70 or later of the (C?) common controls. If you've got MSDN, search for "tooltip NEAR multiline" in the VB documentation for their explanation. I would say that it's a limitation of VB so far and we've just got to live with it. Bummer.

    Toot
    Some cause happiness wherever they go; others, whenever they go.

  5. #5
    Addicted Member
    Join Date
    Jun 1999
    Location
    Los Angeles
    Posts
    186
    Hi, I have a label, that has the same systemcolor as a tool tip, then I code it as visible=False, but on the mouseover I change it to visible=true. It's a workaround and user can't see it's not a tooltip!

    André

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Apr 2000
    Location
    Sheffield, England.
    Posts
    136
    Yeah, I've just been looking at building an OCX which comprises of a flat, multi-line textbox, with it's background and foreground colours changed to standard tooltips colours. Not an ideal solution but as you said, it's a reasonably successful work-around.

    Thanks.

    Visual Basic 6 Enterprise Edition + SP4

  7. #7
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    walk around since real multiline is not possible

    'create multil line tag tips...same use as tool tips except
    'that with tool tips you are restricted to one line..
    'with tag tips you get multiline
    'remember to set the height and width of your
    'label to fit your message
    '
    'this example uses a command button (command1) & a label (label1)
    '
    'on mouse over the command button the tool tag is displayed
    '
    Private Sub Form_Load()

    Label1.BackStyle = 0 'or 1 and set the backcolor to tooltip color
    Label1.Visible = False

    End Sub

    Private Sub Command1_MouseMove(Button As Integer, _
    Shift As Integer, X As Single, Y As Single)

    Dim msg$
    msg$ = "Tag tips for the beginner." & vbCrLf
    msg$ = msg$ & "Multil Line Tag Tips Made Easy" & vbCrLf
    msg$ = msg$ & "Think of the possibilities!"


    Command1.Tag = msg$

    Label1.Caption = Command1.Tag
    Label1.Top = Command1.Top + Command1.Height
    Label1.Left = Command1.Left + Command1.Width / 2
    Label1.Visible = True

    End Sub


    Private Sub Form_MouseMove(Button As Integer, _
    Shift As Integer, X As Single, Y As Single)

    Label1.Visible = False

    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Apr 2000
    Location
    Sheffield, England.
    Posts
    136
    Thanks. That's practically the same as I already got. It even has the same bug!

    (If you move the mouse from the Command1 button over Label (i.e. the tooltip), then it doesn't disappear as a tooltip would.

    Visual Basic 6 Enterprise Edition + SP4

  9. #9
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    This works...

    'mouse move in label and in form...works.


    Private Sub Form_Load()

    Label1.BackStyle = 0 'or 1 and set the backcolor to tooltip color
    Label1.Visible = False

    End Sub

    Private Sub Command1_MouseMove(Button As Integer, _
    Shift As Integer, X As Single, Y As Single)

    Dim msg$
    msg$ = "Tag tips for the beginner." & vbCrLf
    msg$ = msg$ & "Multil Line Tag Tips Made Easy" & vbCrLf
    msg$ = msg$ & "Think of the possibilities!"


    Command1.Tag = msg$

    Label1.Caption = Command1.Tag
    Label1.Top = Command1.Top + Command1.Height
    Label1.Left = Command1.Left + Command1.Width / 2
    Label1.Visible = True

    End Sub





    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Label1.Visible = False
    End Sub

    Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Label1.Visible = False
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  10. #10
    Lively Member
    Join Date
    Jan 1999
    Location
    California
    Posts
    115
    Check out this url:

    http://www.planet-source-code.com/vb...txtCodeId=7968

    or just do a search on 'multi line tooltip'

    Hope this helps

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