Hi Friends,
I'd like to know how to show two or more lines in ToolTipText as we have when pointing to a Word file in Windows Explorer. I've tried VbCr and VbCrLf but none has worked.
Thanks in advance for any help.
Fernando.
Printable View
Hi Friends,
I'd like to know how to show two or more lines in ToolTipText as we have when pointing to a Word file in Windows Explorer. I've tried VbCr and VbCrLf but none has worked.
Thanks in advance for any help.
Fernando.
Code:'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 Label1_MouseMove(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
Label1.Visible = False
End Sub
'use this code in any control near the label as you want to capture
'the event when off the label
Private Sub Form_MouseMove(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
Label1.Visible = False
End Sub
Check this great example for a lot of tooltip-madness ;)
http://perso.wanadoo.fr/vbfrood/engl...s/tooltips.htm
Take a look at the following site:
http://welcome.to/fastlib
This has loads of controls, free!!!!! and one is a multiline baloon type tooltip.
Well worth a visit.
Just as an added thought...
take out the Label1.BackStyle = 0
then...
set Autosize = true
Alignment = 2 - Center
Appearence = 0 - Flat
BackColor = &H00C0FFFF&
Backstyle = 1 - Opaque
Borderstyle = 1 - Fixed Single
This way it 'Looks' like tooltip!
Just started to "play" with the code....
change:
to:Code:
Label1.Top = Command1.Top + Command1.Height
Label1.Left = Command1.Left + Command1.Width / 2
Then the ToolTag follows the mouse and appears a 'little' more naturalCode:
Label1.Top = Command1.Top + Command1.Height + Y
Label1.Left = Command1.Left + X
Just having fun!
:P
I found a problem:
A label cant be 'Over' any controls!
Therefore in a restricted space (lots of othe buttons etc) it wont show up..it will be partially under something else:
Workaround!
Create a frame...then drop the Label1 into the frame.
ste the frame to have:
No border
Visible = false
Then put this in:
Be sure to re-set the label1.visible back to trueCode:
Label1.Left = 0
Label1.Top = 0
Frame1.Width = Label1.Width
Frame1.Height = Label1.Height
Frame1.Top = Command1.Top + Command1.Height + Y
Frame1.Left = Command1.Left + X
Frame1.Visible = True
then wherever it says Label1.visible change it to Frame1.visible. (because when the frame is not visibel...neither are any controls in it)
Viola! You have a Tooltip...multiline...floating over other controls!
Hope this is of USE to SOMEONE! :D
Code I had but don't use.
I'll add your changes to it.
:D