Combobox event tooltip

flaiz

New member
Joined
Jul 12, 2006
Messages
3
Programming Experience
Beginner
IF I have combobox and I need show hint(tool tip) when some text in combo items are large than combobox width.

I'm interesting how event I must use :):confused:
 
Simple i would set the tooltip same as the displayed text of the combo
VB.NET:
[SIZE=2][COLOR=#0000ff]Private [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] ComboBox1_SelectedIndexChanged([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] sender [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Object, [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.EventArgs) [/SIZE][SIZE=2][COLOR=#0000ff]Handles[/COLOR][/SIZE][SIZE=2] ComboBox1.SelectedIndexChanged
[/SIZE][SIZE=2][COLOR=#0000ff]    Me[/COLOR][/SIZE][SIZE=2].ToolTip1.SetToolTip([/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].ComboBox1, [/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].ComboBox1.Text)
[/SIZE][SIZE=2][COLOR=#0000ff]End [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
 
It doesnt work how i want.
I would like to saw the tooltip same as the displayed text of the combo, when I move mouse to this item in opened combo.

Maybe (draw event)
 
That's going to require you to inherit the ComboBox class and get your hands dirty a bit. Here's a C# example for a ListBox. The ComboBox would be similar but I guess more complex because of the drop-down list.
 
How's your c++?, if it's anything like mine then it's as rusty as hell. Here's the combobox that you want. As with all these things if you want to use this control make sure to put some aknowledgements in there for the author. Here's the link....

http://www.codeproject.com/combobox/xtipcombobox.asp

I am going to have a go and try to convert this to vb.net, but no promises.
 
Back
Top