Link to home
Start Free TrialLog in
Avatar of timjc
timjc

asked on

Tool tips equivalent

I want to be able to click on an item in a multi-column listbox and show the equivalent of a tooltip label if the text isn't fully displayed because the list box is not wide enough. How do you do this ? If you can't, please can you suggest an alternative.

Thanx.
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Put an invisible label on your form.

Then, in the MouseUp event you move your label to the X and Y coordinates the the event gives you and make your label visible.
Avatar of timjc
timjc

ASKER

How do I stop that label from being partially hidden by the form should it want to reach further to the right than the form is ?
When you want to show the label, check that X + label.Width is less than form.scalewidth.

If not, you can move your label some twips to the left.

Maybe you can deal with autosize and wordwrap property of the label.
Also you could use tooltips and change it's text

like this.........

Private Sub List1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim ypos

ypos = Int(Y / (List1.FontSize * 25))
List1.ToolTipText = List1.List(ypos)

End Sub
ASKER CERTIFIED SOLUTION
Avatar of anzen
anzen

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial