How do I split a line into a tooltip using a custom form?

I am trying to find a way to put breaks on the mouse tip

I would like to display

Full - full overwrite from external Partial - only overwrites non-empty from external No-input data only in empty cells

to

Full - full overwrite from external Partial - only overwrites without spaces from external No - enters data only in blank cells

is there any way to do this

using Excel 2010 btw

+3


source to share


3 answers


Line feeds / carriage returns in the property are ControlTipText

simply ignored by excel. A possible workaround is to have a hidden multiline label (formatted to look like a tooltip) whose visibility is toggled using both the bound control and custom form events MouseMove

- i.e. SomeControl_MouseMove

shows the shortcut and ParentForm_MouseMove

hides it again (possibly after a delay). This approach can be a bit overwhelmed or missed if the user moves the pointer quickly. Another (better, IMHO) solution should be to have a permanently visible label or textbox object somewhere in your form whose signature / value changes depending on which control is currently under the mouse pointer, again using eventsMouseMove

...



EDIT: If, as I suspect, your tooltip is related to the combobox / listbox control, you might consider having the option descriptions in the second column in the control?

0


source


I tried to keep it easy (no api, very short code):



Private Sub ListBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
'If Events Then
    Dim list_index As Long, Zero As Long
    Zero = Me.ListBox1.TopIndex
    list_index = Y \ (8 + 2) + Zero ' ; 8 si the size of Font ; note \ is a integer division
    'Me.label1 = Y          'test label
    'Me.label2 = list_index 'test label
    'Me.label3 = Zero       'test label
    With Me.ListBox1
        .ControlTipText = .List(list_index, 1)
    End With
'End If
End Sub

      

0


source


I'm not sure I understand this question. By "mouse tip" you mean a comment, right? There should be no problem creating line breaks. Just hitting enter / * return * where you want the break to work fine for me. Here's a detailed set of directions for what I've done.

1) I have selected the desired cell.

2) In the review feed, I selected a new comment.

3) Then I copied and entered the text in the comment field.

4) I resized the comment box to prevent wrapping.

5) Finally, I removed the text and rewrote it manually to make sure that I can manually enter line breaks.

Hope this helps. Greetings.

-3


source







All Articles