PDA

View Full Version : Tooltip for Listbox selection - different per selection



Rasm
04-07-2012, 11:34 PM
I want to be able to display a tooltip when you select a value in a ListBox - in other words as you change the ListIndex the tooltip changes - right now I have a label that shows what each function does when you select a value in the ListBox. But the label takes up a lot of space on my userform.
Any suggestions would be apreciated.

Excel Fox
04-08-2012, 07:11 AM
You mean the label is one long text across the userform, and you are not able to have multi-lines?

Rick Rothstein
04-08-2012, 07:55 AM
UserForm controls have a ToolTip property, but its name is not ToolTip, rather, it is name ControlTipText. However, it does not look like it will function the way you want. It appears that ToolTips display when you hover over an object... once you click the object, the ToolTip disappears and stays disappeared until you move the cursor off of the control and then move it back over the control and hover there... selecting an item in your ListBox won't let the ToolTip display until you move the cursor away from the contol and then move it back over it again. Perhaps you can make your UserForm a little taller (say two text lines taller) and put your label down at the bottom of the UserForm so it acts like a Status Bar (which you could update in the ListBox's Click event). Or are you wanting to display a lot more text than that?

Rasm
04-08-2012, 08:05 AM
Lets say my list box has 3 different functions you can chose - so when you hover over function #1 (listindex 0) - I then want one tooltip - if youhover over the second - I want the tooltip text to change. Right now I have a multi line label that I substituted the controltooltip with.
I see Ricks point - I can change the controltooltip via code - as I hover over an item - however I have to let the focus go - then come back to get another choice. So that will not work in reality