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.
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.