Why is the tooltip displayed manually with the help ToolTip.Shownot displayed when the window containing the control is inactive?
public class MyControl : Button
{
private _tip;
public string ToolTip
{
get { return _tip; }
set { _tip = value; }
}
private ToolTip _toolTip = new ToolTip();
public MyControl()
{
_toolTip.UseAnimation = false;
_toolTip.UseFading = false;
_toolTip.ShowAlways = true;
}
protected override void OnMouseHover(EventArgs e)
{
_toolTip.Show(_tip, this, 0, Height);
base.OnMouseHover(e);
}
protected override void OnMouseLeave(EventArgs e)
{
_toolTip.Hide(this);
base.OnMouseLeave(e);
}
}
I went on ToolTip.Showbecause I have to have a tooltip on the screen for an unlimited time, which is impossible when using the usual one ToolTip. I also like the idea of having tooltip text as part of the management itself. But unfortunately, when showing a tooltip for an inactive window (despite ShowAlways = true), it just doesn't work.
The event is OnMouseHowerhighlighted, but _toolTip.Showdoes nothing .. if the window is not activated, then everything works.
Bounty
( , , IContainer).