ToolStrip buttons are blinking
I have a window form with a tooltip in it with multiple buttons. When the mouse is over a toolbar button then the toolbar button starts blinking ... it looks like it gains and loses focus every second. This results in the click doing nothing if the user clicks while the button has no focus, so the user needs to click the button again and use it correctly.
Does anyone know about this?
I need to get answers as soon as possible ...
Many thanks
+2
source to share
2 answers
Here is the code to manually show the tool tip over an element:
private readonly ToolTip currentToolTip = new ToolTip();
private void ToolStripItem_MouseEnter(object sender, EventArgs e)
{
ToolStripItem item = (ToolStripItem)sender;
this.currentToolTip.Show(item.ToolTipText, item.Owner, item.Bounds.X, -20);
}
private void ToolStripItem_MouseLeave(object sender, EventArgs e)
{
ToolStripItem item = (ToolStripItem)sender;
this.currentToolTip.Hide(item.Owner);
}
You need to add event handlers to all ToolStripItems and set ShowItemToolTips ToolStrips to false.
+1
source to share