Apr 12th, 2002, 07:37 AM
Setthing Tooltip for Combobox Items
How do I set tooltip value for each combo box items such that the tooltip displays when I scroll down the list and highlight any item. I can make it to show the tooltip only for the selected item after I click but now when I mouse over or highlight. Any ideas.
Apr 12th, 2002, 07:39 AM
i don't believe that items in a combobox have tooltiptext properties... since the items themselves are not objects... the control itself is an object.. the items in the drop down are just text..
Apr 12th, 2002, 07:43 AM
Combo box controls do not have any type of Mouse event. There is no MouseMove, MouseUp, MouseDown, etc. If you switched to a Listbox, they do have Mouse controls, but you still couldn't show individual tooltips for individual items unless you wrote individual tooltips back to a Db table, and read them everytime the mouse moved to a new it.
This is, however, impractical. Thats way too many Db reads, and if you Db is on a network server, the traffic would go monsterous.
Apr 12th, 2002, 07:50 AM
Exactly Kleinma. For the combo box itself, it works after the item is selected. However, is there any api or other ways how you could get the combo items to behave similarly. I am using an api call for the listbox using mouse_move event, but no such event is available in Combo Box. My items text in combo box may be long and I do not want the combo box to be as long as the text, therefore, I thought tooltiptext might be helpful, if there is a way to do it not sacrificing what Hack has posted.
Apr 12th, 2002, 08:07 AM
ummm well i guess instead of doing database reads you could load the tooltips into variables or an array or something like that when you load the actual box.. but that doesn't change the fact that there are no event (like hack said) to determine when the mouse is over a specific item... maybe the list box would be a better bet?
attached is a little app i wrote for someone on here when i was bored.. maybe u could mess around with that... it makes a form simulate as a tooltip.. because the person i actually made it for wanted a tooltip that would change its message while over the same item.. which the tool tip doesn do... anyway.. maybe you could mess around with it and get it to help a little.. even if you dont get exactly what you are after..
Apr 12th, 2002, 08:08 AM
Would it be practical for you to extend the length of the combo box, at run time, to the length of the longest item, whatever that item may be, now or in the future?
Apr 12th, 2002, 10:02 AM
No, extending combo box to the max length of the item would not be practical in my case. I cannot use listbox because listbox does not have a drop down feature. List box shows all the items in one view.
But, I am going to look at what Kleinma has done.
Dec 4th, 2003, 11:14 AM
I know this was posted a very long time ago, but worth a shot. Did you ever figure out a way of doing this? I have the same exact problem. If you did not find a solution could you please let me know anyway so that I am not here waiting .
Motto: Anything for a laugh.
Getting second place only means you are the first loser to cross the finish line.
Dec 4th, 2003, 12:12 PM
Hack f*****g hell, how come you have such a huge post count!
Dec 4th, 2003, 04:02 PM
you wont get an answer from him since he has since left the forums over a year ago...
Dec 4th, 2003, 04:06 PM
Dec 4th, 2003, 05:25 PM
Click Here to Expand Forum to Full Width