Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ToolTipText (VB6)

    Just modifying some code, to :

    1) Set a Shape (Bor1 to 16) to .Visible = true

    2) Set an Image controls ToolTipText (Img1 to 16) to a hidden text controls.Text.

    The code works, but just checking to see if I have done it correctly:

    <pre>Private Function imgclick(i As Integer)
    If Me.Controls("Text" & i) = vbNullString Then Exit Function
    Pdf1.Visible = False
    Dim z As Integer
    For z = 1 To intNumberOfImages
    Me.Controls("bor" & z).Visible = False
    Next

    Me.PreviewImg.Picture = Me.Controls("img" & i).Picture
    Me.Controls("bor" & i).Visible = True
    Me.Controls("img" & i).ToolTipText = Me.Controls("text" & i).Text

    End Function</pre>


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ToolTipText (VB6)

    Looks OK to me, so if the code works, I wouldn't worry about it.

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ToolTipText (VB6)

    Thanks Hans, Thats re-assuring, but one question.

    I am adding to the ToolTipText.

    <pre> Me.Controls("img" & i).ToolTipText = Me.Controls("text" & i).Text & vbCrlf & _
    Me.Controls("txtComment" & i).Text</pre>


    This returns the entries from both Text & Comment, but the vbCrlf doesn't.

    All is visible on one line of the toolTipText.

    Is there another set of rules to break the ToolTip up into lines like you can with a msgBox

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ToolTipText (VB6)

    The standard tooltip in VB6 does not support multiple lines. There are ways to get around this using Windows API calls. A Google search for vb6 tooltiptext multiline will turn up details. For example, you can use Eduardo Morcillo's Tooltip2.dll, a free download from MultilineTooltips Class. You would have to distribute the dll with your application. I don't know if it's worth the hassle.

  5. #5
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ToolTipText (VB6)

    Hans

    Yes you're probably right.

    I think I'm jumping through hoops again !!

    Have a good weekend

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •