Arkadaşın kodu
1 başvuru private void buttonOnOff_Click(object sender, EventArgs e) {
// declare a boolean variable to keep track of whether the loop is running bool isRunning = false;
// create an event handler for the button press event
// if the loop is not running, start it {
if (!isRunning)
while (!isRunning)
{
// do something in the loop // ...
SendKeys.Send("1");
// check if the button has been pressed again
Application. DoEvents(); // this allows the button click event to be handled while the loop is running
if (!isRunning)
{
}
isRunning = false;
} // if the loop is already running, stop it else if (isRunning == false) {
isRunning false; =
MessageBox.Show("BİTTİ");