简体   繁体   中英

Click event on toolbar button - Winforms

I have a user controls on winforms that contains a toolbar, the problem is whenever the application loses focus then i have to click the toolbar button twice to trigger the click event. I know this is because the first click is for the application to have the focus then then second click will be the actual click event. This only happens to toolbar control but not on other winforms controls.

我分层寻找使用ToolStrip控件解决此问题的正确解决方案,我所做的是我只是将其更改为Button控件,将其设置为Flatstyle,然后添加了一些鼠标悬停来模仿ToolStrip。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM