I have a .NET 2.0 WinForms application with a ToolStrip on my main form. Sometimes, the ToolStrip icons don\'t respond to the first mouse click, so I have to click the icon
Here is the implementation for @Doc Brown's solution:
public class ToolStripX : ToolStrip
{
private const int WM_MOUSEACTIVATE = 0x0021;
private const int MA_ACTIVATEANDEAT = 2;
private const int MA_ACTIVATE = 1;
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg == WM_MOUSEACTIVATE &&
m.Result == (IntPtr)MA_ACTIVATEANDEAT)
{
m.Result = (IntPtr)MA_ACTIVATE;
}
}
}