开发者

Click events in Winform UserControl

开发者 https://www.devze.com 2023-01-27 11:58 出处:网络
I have a UserControl which acts like a basic button control (it is hand drawn). I have noticed however that when I repeatedly click the control (fast) that I don\'t get all the click events that I wo

I have a UserControl which acts like a basic button control (it is hand drawn).

I have noticed however that when I repeatedly click the control (fast) that I don't get all the click events that I would expect. If I click slowly I do get one click event per physical click.

Can anyone sugg开发者_Python百科est why this is and how to fix the problem?


I think the clicks are converted into double clicks.

Try adding the following line to the constructor:

SetStyle(ControlStyles.StandardDoubleClick, false);


If you're previous click event code isnt finished yet the next 'click' could be ignored.

0

精彩评论

暂无评论...
验证码 换一张
取 消