Hi, There
I need to display tooltips for disabled controls, so I generated my own MouseHover event handler for the parent control containing my disabled controls. Here's a code snipet:
void Overriding_MouseHover(object sender, EventArgs e)
{ string tipText = mFormTips.GetToolTip(this); if ((tipText != null) && (tipText.Length > 0)) { Point clientLoc = this.PointToClient(Cursor.Position); Control child = this.GetChildAtPoint(clientLoc); if (child != null && child.Enabled == false) { mFormTips.Show(tipText, this, 5000); } } }
{
string tipText = mFormTips.GetToolTip(this);
if ((tipText != null) && (tipText.Length > 0))
Point clientLoc = this.PointToClient(Cursor.Position);
Control child = this.GetChildAtPoint(clientLoc);
if (child != null && child.Enabled == false)
mFormTips.Show(tipText, this, 5000);
}
For regular windows control like a groupBox, it worked fine. But for UltraCheckEditor and UltraCombo, the tooltip does show up, but only for less than a second, then it disappeared. Note that I'm not using the UltraToolTipManager, only the regular windows ToolTip here.
Can anyone suggest something to look out for? I tried to handle all mouse events of a disabled UltraCheckEditor, just to confirm that none of the mouse events are handled by the disabled checkbox.
Thanks in advance.
Richard Zhu
Hi Richard,
Can you post a small sample project demonstrating this?
I can't think of any reason off the top of my head why the CheckEditor should be any different than any other control in this regard.
If you are trapping events, you should probably trap for events of the form (this), since that's where you are applying the tooltip. The CheckEditor events won't matter in that case. My guess is that the form is firing Leave of LostFocus or maybe just MouseMove for some reason.