.netwinformstoolstrip

ToolStrip sometimes not responding to a mouse click


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 twice. It's just a standard ToolStrip with several icons and tooltip texts, I don't do anything special. Is this common?


Solution

  • If the application window hasn’t got the focus, you have to click the ToolStrip button twice. The first click sets the focus to the window, the second raises the click event. This is (unfortunately) the default behaviour and it’s by design. Microsoft Word shows the same behaviour (even though the .NET ToolStrip is not the same control).