Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tooltip on custom control

I created a custom control (inherited from UserControl) with some controls in it (label, textbox, slider) and assigned it a supertooltip (from devComponents dotnetbar; same problem with normal; check picture) in Designer.

But the tooltip doesn't come up. On "normal" controls it works, so it's a problem with the custom control.

Any idea what's wrong?

Edit: Here's a sample: Download

While making the sample i think I found the failure. The tooltip comes only up if the mouse hovers the parent. Possible? If yes: Any idea how to fix?

alt text

like image 221
freakinpenguin Avatar asked Nov 24 '10 10:11

freakinpenguin


1 Answers

Setting the tooltip on the user control displays the tooltip only when you hover over 'empty' canvas of the user control, not when you hover over child controls that are part of the user control. This is by design, you need to manually implement some workaround if you want other behavior.

One suggestion that is mentioned (originally from www.msnewsgroups.net, but which is no longer available):

The easy way to handle this problem is to have your UserControl export a ToolTop property that, when it's set, just sets the ToolTip properties of all of its component controls. The get accessor can just return the ToolTip from any component within the UserControl, as they'll all be the same.

The only downside to doing it this way is that the tool tip will be redisplayed whenever the user moves from one component to another within the user control, so the tool tip can become annoyingly persistent at times.

like image 180
Daan Avatar answered Nov 15 '22 09:11

Daan