private bool StopLoop = true;
for (int i = 0; i < 30; i++) { if (!StopLoop) // Your actions }
private void Button_Click(object sender, EventArgs e) { StopLoop = false; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)