开发者

C# MouseClick Event a bit laggy, how can I fix this?

开发者 https://www.devze.com 2023-01-19 06:00 出处:网络
I\'m making a craps game, and I have a \"Craps Table\" image in a PictureBox Control. I\'ve made a MouseClick event handler for the PictureBox to check what region was selected by the user, and add a

I'm making a craps game, and I have a "Craps Table" image in a PictureBox Control.

I've made a MouseClick event handler for the PictureBox to check what region was selected by the user, and add a bet to that "Part of the Craps Table" when clicked.

Everything works great, except if I click the region very quickly, the event fires only once for every two clicks (Approx).

I've searched everywhere, and not quite sure 开发者_开发知识库what I'm doing wrong. I thought at first it might be a graphics problem, but I've ruled just about everything out, and I'm thinking that the event simply isn't firing properly at high click speeds, I have to pause for half a second between clicks for it to fire.

Thanks for any advice..


Also guessing, Try MouseDown instead of MouseClick...

Another thing to check: If your app is high-cpu intensive, and the UI thread is mostly busy, the mouse events will arrive late.


My guess is that by clicking very quickly, you're triggering the doubleclick event instead of click

0

精彩评论

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