Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Click events in Winform UserControl

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 suggest why this is and how to fix the problem?

like image 964
BarneyHDog Avatar asked Nov 28 '10 10:11

BarneyHDog


People also ask

What is UserControl in Winforms?

A UserControl is a collection of controls placed together to be used in a certain way. For example you can place a GroupBox that contains Textbox's, Checkboxes, etc. This is useful when you have to place the same group of controls on/in multiple forms or tabs.

What is UserControl in C#?

Definition of C# User Control. C# user control is defined as an implementation in programming language of C# to provide an empty control and this control can be leveraged to create other controls. This implementation provides additional flexibility to re-use controls in a large-scale web project.


Video Answer


1 Answers

I think the clicks are converted into double clicks.

Try adding the following line to the constructor:

SetStyle(ControlStyles.StandardDoubleClick, false);
like image 112
Pieter van Ginkel Avatar answered Oct 01 '22 18:10

Pieter van Ginkel