Lining up the text in a tool tip, with the text in a combobox
Posted
by Steve P
on Stack Overflow
See other posts from Stack Overflow
or by Steve P
Published on 2009-01-18T13:28:28Z
Indexed on
2010/06/17
0:02 UTC
Read the original article
Hit count: 212
I see a lot of programs where if the text doesn't fit inside the bounds of the control, you can put your mouse over the control and the tooltip text will show you the full unclipped text, and also the tooltip text lines up completly with the text in the control.
I'm trying to do that with a combobox in VB 2005 (.net version 2.0). In the tooltip draw event I've tried setting the tooltip location to the location of the AssociatedControl.DisplayRectangle, and the AssociatedControl.ClientRectangle. Each of these seem to put the tooltip text in the top left corner of the combobox, just slightly offset from the text in the combobox. Is there some type of padding I need to account for? or what's going on here?
© Stack Overflow or respective owner