Assigning control tip text

  • Thread starter Thread starter kirkm
  • Start date Start date
K

kirkm

Can you add a linefeed programicably?

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

Thanks - Kirk
 
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...
 
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
 
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
 

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

Back
Top