I want to check if a button is clicked with c#
like this
private void btnFillo_Click(object sender, EventArgs e)
{
btnFillo.Text = "text";
// if (btnFillo clicked again) {
// do something
// }
}
private int clickCounter = 0;
private void btnFillo_Click (object sender, EventArgs e) {
btnFillo.Text = "text";
if (clickCounter >= 1) {
// do something
clickCounter = 0;
}
else clickCounter += 1;
}
if you want to do something just on second clicks simply use a boolean:
private bool isClicked = false;
private void btnFillo_Click (object sender, EventArgs e) {
btnFillo.Text = "text";
if (isClicked) {
// do something
isClicked = false;
} else isClicked = true;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With