Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tooltiptext

Status
Not open for further replies.

SpiderFlight

Programmer
Aug 22, 2001
37
US
I'm using VB6. Under the ToolTipText property for my label I have the following text:

This option will allow polling of the selected directory. EDI Eligibility Benefit Inquiry and Response (270/271) processing will automatically begin once a file is detected in the directory.

I would like this to be displayed on three lines instead of one line. I have also tried setting the property in my code as well but I get the same results. I have tried adding " & VBCRLF & where I want the break to occur but to no avail.

Any Help would be greatly appreciated.

Thanks in advance
 
I sure don't have a clue, but I did a little search for you and turned up this link you can download from.


I tried it and it works pretty well. Hope it will do what you want.
Rob
Just my $.02.
 
I'm afraid you can't make the tool tip text be three lines long. However, you can rig it (although not perfectly).

Here's the code I used:

---Start Code---
Private Sub Form_Load()

txtTip.Text = "This is a multiline" & vbCrLf & "tool tip."

End Sub

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

txtTip.Visible = False

End Sub

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

txtTip.Left = X
txtTip.Top = Y
txtTip.Visible = True

End Sub
--- End Code ---

The form is just your basic form, and there are two text boxes (Text1--the control, and txtTip--the tool tip). I changed the colors and format of txtTip to look like a tool tip. Initially txtTip.Visible is false.

When the user moves his mouse over Text1 (the control for which txtTip is the tool tip), txtTip becomes visible, and its X and Y coords are set to the X and Y coords of the mouse. When the mouse moves off of the control and over the form, the tool tip is made invisible again.

This is not perfect, but may give you some ideas.

Jon
 
VABchJohn-

I took a stab at it but couldn't create a new line.
Anyway, the type, and length, of the message that you want to display seems more suited for the "What's This?" help system. Have you looked into that?

Good Luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top