5
votes

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

1
Can you post some of your code, so we can understand what's going on?Frédéric Hamidi
Well, what exactly do you want? There is nothing special in the code.freakinpenguin
I have tried to reproduce this using a regular System.Windows.Forms.ToolTip (that is what you mean by "same problem with normal", right?), but I cannot reproduce your problem. The tooltip shows up just fine. I think you need to provide more information and / or code in order for people to reproduce it.Daan
@Daan: Check edited Question. And yes, that's what I meant ;)freakinpenguin

1 Answers

9
votes

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.