Hi to all . How do I add a row in the control tip text ? scr(52) scr52.jpg Ragards Kostas
Hi to all . How do I add a row in the control tip text ? scr(52) scr52.jpg Ragards Kostas
I don't think you can.
I can think of a long work around. In fact. I used something similar when I wanted an instruction label overlaid the control. I used input validation to position and show the label(s), and the Label_Click Event to unload it. But I think you will need to use a less User friendly method.
You can use MouseDown + Button|+Ctrl|+Alt|+Shift to load the label.
I expect the student to do their homework and find all the errrors I leeve in.
Please take the time to read the Forum FAQ
Taking on SamT's idea, see attached.
Uses labels whose Visible property is originally set to False.
Textbox Mouseover event to show a label
Userform Mouseover event to hide them.
p45cal
Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.
Hi Thank you for your answer and for the example ,but where can i'll find the three little dots, so to make the multi line row?
Regards
Those 3 dots are an ellipsis which I get by holding down the left Alt key and typing 0133 on the number pad.
However, this has nothing to do with making this multiline.
Use Ctrl + Return to get a new line on a label control.
Last edited by p45cal; 12-01-2019 at 04:33 PM.
p45cal
Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.
Thank you very much for your help.
The last question (i hope) is how can i get the (Ctrl + Return) in run time, so to create a dynamic label? and i want to visible the label in some time and when the time expire ,the label be visible=false again
Regards
Last edited by p45cal; 12-01-2019 at 04:33 PM.
p45cal
Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.
not hard, convoluted, not very User Friendly compared to mouse click and mouseMovei want to visible the label in some time and when the time expire ,the label be visible=false again
I expect the student to do their homework and find all the errrors I leeve in.
Please take the time to read the Forum FAQ
You can Add and Remove the 'tooltip' labels at run time
Option Explicit Dim bTooltip As Boolean Private Sub UserForm_Initialize() bTooltip = False End Sub Private Sub TextBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Call AddToolTip(TextBox1, "This is line 1" & vbLf & "This is line 2") End Sub Private Sub TextBox2_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Call AddToolTip(TextBox2, "This is aaaaaaaaaaaaaaaaaaaaaaaaaaaaa line 3" & vbLf & "This is bbbbbbbbbbbbbbbbbbb line 4" & vbLf & _ "This is cccccccccccccccc line 5" & vbLf & "This is dddddddd line 6") End Sub Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Dim oControl As MSForms.Control If Not bTooltip Then Exit Sub For Each oControl In Controls If TypeName(oControl) = "Label" Then If oControl.Name Like "*_Tooltip" Then Me.Controls.Remove oControl.Name End If End If Next bTooltip = False End Sub Private Sub AddToolTip(ctrl As MSForms.Control, Tooltip As String) Dim oLabel As MSForms.Label Set oLabel = Me.Controls.Add("Forms.Label.1", ctrl.Name & "_Tooltip", True) With oLabel .BackColor = &HE1FFFF .Caption = Format(Time, "hh:mm:ss") & vbLf & vbLf & Tooltip .Left = ctrl.Left + 10 .Top = ctrl.Top + 10 .BorderStyle = fmBorderStyleSingle .Enabled = True .WordWrap = False .AutoSize = True End With bTooltip = True End Sub Private Sub CommandButton1_Click() Me.Hide Unload Me End Sub
---------------------------------------------------------------------------------------------------------------------
Paul
Remember: Tell us WHAT you want to do, not HOW you think you want to do it
1. Use [CODE] ....[/CODE ] Tags for readability
[CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
2. Upload an example
Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
3. Mark the thread as [Solved] when you have an answer
Thread Tools (on the top right corner, above the first message)
4. Read the Forum FAQ, especially the part about cross-posting in other forums
http://www.vbaexpress.com/forum/faq...._new_faq_item3
Thank you all for your answers
Regards