who 'eats' my mouse click messages?

  • Thread starter Thread starter Alon
  • Start date Start date
A

Alon

Hi,
I have a simple form with a simple button that does the following:
static int button1Count = 0;
void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Debug.WriteLine((button1Count++).ToString()
+" Button1 - click");
System.Threading.Thread.Sleep(3000);
System.Diagnostics.Debug.WriteLine("End Sleep");
}

As you can see, when I click the button, it writes something to the output
window and sleeps for 3 seconds. Then, it writes another line to the output
window.
Now, I do the following: I press 3 times quick enough that it takes less
than 3 seconds.
I notice that sometimes the button get pressed 3 times and sometimes, only
twice.
It looks like the messages are 'eaten' somehow...
Can someone explain this? I tried to look for an explanation but failed to
find such.

Thanks in advance,
Alon.
 
is it because the time between two mouse clicks too short makes
windows translated it as a double click event?

I remember Window has a class style to control the translation, but
can't remember clearly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top