ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Assigning control tip text (https://www.excelbanter.com/excel-programming/424139-assigning-control-tip-text.html)

kirkm[_8_]

Assigning control tip text
 

Can you add a linefeed programicably?

I'm finding chr$(13) and vblf etc. just print a square in the text.

Thanks - Kirk

Kenneth Hobson[_4_]

Assigning control tip text
 
It can only be one line long.

Oorang[_2_]

Assigning control tip text
 

vbLf should work fine.

Code:
--------------------
Sub Test()
Selection.Value = "Did it " & vbLf & "work?"
End Sub

--------------------


--
Oorang
------------------------------------------------------------------------
Oorang's Profile: http://www.thecodecage.com/forumz/member.php?userid=129
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=64545


Simon Lloyd[_1031_]

Assigning control tip text
 

Don't use the string $, you can use a number of ways
Code:
--------------------
MsgBox "This is a" & vbLf & "test for" & Chr(10) & "adding new" & vbNewLine & "Lines!"

--------------------
each of the new line commands can be used on thier own or mixed as
seen, but best practice would dictate that you stick with one!

kirkm;231004 Wrote:
Can you add a linefeed programicably?

I'm finding chr$(13) and vblf etc. just print a square in the text.

Thanks - Kirk



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=64545


kirkm[_8_]

Assigning control tip text
 
On Sat, 14 Feb 2009 20:27:01 -0800, Kenneth Hobson
wrote:

It can only be one line long.


Thanks... so be it !

Cheers - Kirk

kirkm[_8_]

Assigning control tip text
 
On Sun, 15 Feb 2009 05:42:36 +0000, Oorang
wrote:


vbLf should work fine.

Code:
--------------------
Sub Test()
Selection.Value = "Did it " & vbLf & "work?"
End Sub

--------------------


Seems the answer is No, not in a control tip text string.

Hope that's right... so often there's more to it...

kirkm[_8_]

Assigning control tip text
 
On Sun, 15 Feb 2009 07:46:37 +0000, Simon Lloyd
wrote:


Don't use the string $, you can use a number of ways
Code:
--------------------
MsgBox "This is a" & vbLf & "test for" & Chr(10) & "adding new" & vbNewLine & "Lines!"


Gotcha. But again not in the control text enviroment.
Thanks - Kirk

Dave Peterson

Assigning control tip text
 
Is this on a userform?

If yes:

Saved from a previous post.

How about just putting a label over the control and that control in a frame.

Then when you mouse over the frame, it'll hide the label. But when you mouse
over the control, you'll show the label.

Option Explicit
Private Sub CommandButton1_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Me.Label1.Visible = True
End Sub
Private Sub Frame1_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Me.Label1.Visible = False
End Sub



kirkm wrote:

Can you add a linefeed programicably?

I'm finding chr$(13) and vblf etc. just print a square in the text.

Thanks - Kirk


--

Dave Peterson

Kenneth Hobson[_4_]

Assigning control tip text
 
Similar to what Dave said, here is another Label method for a pseudo tooltip
method on a userform.

Private Sub UserForm_Initialize()
Label1.Visible = False
End Sub

Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
Label1.Visible = False
End Sub

Private Sub CommandButton1_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
With Label1
.Caption = "CommandButton1:" & vbCrLf & "Line2"
.Left = CommandButton1.Left
.Top = CommandButton1.Top - 30
.Visible = True
End With
End Sub

Leith Ross[_759_]

Assigning control tip text
 

Hello kirm,

Dave's suggestion is the easiest to implement. Again, if this on a
UserForm you can create true multi-line ToolTips. This requires using a
lot of Windows API calls to accomplish the task. Thought you might like
to know.


--
Leith Ross

Sincerely,
Leith Ross

'The Code Cage' (http://www.thecodecage.com/)
------------------------------------------------------------------------
Leith Ross's Profile: http://www.thecodecage.com/forumz/member.php?userid=75
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=64545



All times are GMT +1. The time now is 06:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com