newline in ControlTipText

D

Dan Ackermann

Hi all,
How to make ControlTipText shown on more then one line ???

mycontrol.ControlTipText = "Should be" + vbcrlf + "on 2 lines"
vbcrlf will not do the job because it's not displayed correctly but how
to????

Any help is appreciated.
TIA

Dan
 
P

Perry

I'm afraid this is not possible.

You can however mimic the multiline control tooltip text.

Situation:
Userform containing a textbox (TextBox1) and a label (Label1)
When y've drawn the above controls on yr userform, paste below
code in the userform module and run it.
Mousemove the textbox to bring up the tooltip ...

<begin VBA>
Private Sub TextBox1_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, _
ByVal X As Single, _
ByVal Y As Single)

With Me.Label1
.Left = Me.TextBox1.Left + X
.Top = Me.TextBox1.Top + Y + _
Me.TextBox1.Height
.Visible = True
End With
End Sub

Private Sub UserForm_Initialize()
With Me.Label1
.BackColor = 12648447
.BorderStyle = fmBorderStyleSingle
.Caption = "Perry" & vbCrLf & "the second tooltip line"
End With
End Sub

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

Me.Label1.Visible = False
End Sub

<end VBA>

Krgrds,
Perry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top