I can't believe I am having an issue with this, but such is life.
I have a button on a Winform with a click event that runs some code. I disable the button, run my code, then enable the button. The weird part is any click that happens on the button while disabled merely waits for the button to be enabled again, and then runs.
private void FooBar_Click(object sender, EventArgs e){
Enabled = false; //disable the form (yeah, i tried that)
btnFooBar.Enabled = false;
//DO SOME STUFF
Enabled = true;
btnFooBar.Enabled = true;
}
I tried adding a check to the beginning, but it is always true (cause it just waits for the execution to end) :
if(!btnFooBar.Enabled)
{ return;}
Is there a way for those disabled clicks to be ignored?