Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tooltips and Comboboxes

Status
Not open for further replies.

davepruce

Programmer
Dec 18, 2001
17
GB
Can anyone point me at some code (or tell me it cant be done!).
I want to have a combobox with a list of customer numbers and when you open it and hover over an entry, I want the tooltip to display some data about the customer number (name/address etc).
I'm sure I've seen it somewhere, but can't remember where!
 
You can try this... Make a form, small one, that looks like tool tip window (no borders, and a label that covers the whole thing. set the auto size of the label to true. set a size changed event for the label to size the form to the same size. make a sub procedure like this (in a mod file so it is global)

Public Sub myToolTipForm(myText As String)
Dim myToolTip As New ToolTipForm
myTooTip.Label1.Text = myText
myToolTip.Show
End Sub

On the tooltip form also have timer that turns it off after a few seconds.

Set up a string array with all the tooltips you will need, make sure they are in the same order as the items in your combo box.

In the combobox mouse hover event call the sub procedure like this.

myToolTip(myTextArray(combobox1.selectedindex))

I can do a sample for you if this is not clear enough.

Hope this helps.

Becca

PS: If anyone knows a better way, please tell me too :)
 
Thanks Becca - it looks good. I wont have time to try it for a couple of days, but soon as I have I'll let you know

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top