开发者

Tooltip on custom control

I created a custom control (inherited from UserControl) with some controls in i开发者_开发百科t (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?

Tooltip on custom control


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜