To show the whole text in a tooltip text
Hi,
No it wasn't
But wait, I found a way to solve the problem...
General section level of UserForm:
Public BoxWidth As Single
Private Sub UserForm_Initialize()
BoxWidth=150 'Initial width of the control
Public DisplayText()
txtBox1 = Trim(MyString)
txtBox1.ControlTipText = ""
txtBox1.AutoSize = True
If txtBox1.Width BoxWidth Then
txtBox1.ControlTipText = Trim(MyString)
End If
txtBox1.Width = BoxWidth
txtBox1.AutoSize = False
End Sub
Thanks anyway
Pierre
"RB Smissaert" a écrit dans le message de
...
Was it?
RBS
"Pierre Archambault" wrote in message
.. .
Wow !
Who told you that the text that goes in the textBox was 25 characters
long
?
"RB Smissaert" a écrit dans le message
de
...
Private Sub TextBox1_Change()
If Len(TextBox1) 25 Then
TextBox1.ControlTipText = TextBox1
Else
TextBox1.ControlTipText = ""
End If
End Sub
RBS
"Pierre Archambault" wrote in message
.. .
Hi,
I have UserForm which contains a textBox which cannot always display
all
of
its content because the width of the textBox is limited by my
program.
I
would like to give the user the possibility to see all of its content
by
showing a tooltip text like the one we have when for instance, the
left
window of Windows Explorer isn't wide enough to show its whole
content.
When
the mouse passes over the truncated text, we can see it in that
tooltip
text. Is there a way we can do the same in Excel ?
I dont want to always show that tooltip text: it would not be
usefull
when
the text is short enough to be visible in the textBox. I don't want
either
the textBox to be multiline neither have a scrollbar; its height must
be
fixed at 1 line.
Thanks.
Pierre
|