MouseEventArgs, Clicks is always 1 ?

  • Thread starter Thread starter Ralf Jablonski
  • Start date Start date
R

Ralf Jablonski

Hello all,
The property MouseEventArgs.Clicks seems always to be 1, regarsless how
often I click at a position.
If I click 3 times, then my mouse event up handler is called 3 times, but
always with Clicks==1.
Does I have misunderstood something ?
Any hints ?
 
The Clicks property tells you whether or not the user has either single or
double clicked. If you double-click, the first click will fire an event with
Clicks = 1 and the second will fire an event with Clicks = 2. If you click
three times rapidly it will register as 1, 2, and then 1 again.
 
That's what I expected too !
But Clicks is always one.
Even the simplest possible program with only one form does not behave this
way.
Environment is VS 7.1.3088, NF 1.1.4322.
Can you provide a simple example which works for you ?
Thanks in advance.
 
Here's what I did:

1. Create a new Windows Forms app.
2. Drag a label onto the form.
3. Set up an event handler for the MouseDown event of the form with
"this.label1.Text = e.Clicks.ToString();" as the body.
4. Run the app and try clicks and double clicks. It'll show the Clicks value
in the label.
 
You are right, for a label it seems to work.
If you try this with a panel or picturebox it will NOT work.
Is this a bug, or is there any reason for this behaviour ?
Thanks
 
Back
Top