EDN Admin
Well-known member
Hi,
In my windows form there are two buttons , <b>Start</b> and <b>Stop</b>. When i press the <b>Start </b>button a loop (While loop or a foreach or any other loop) starts to execute and it will take some time for it to end.
<div align=left>My question is how to stop the loop <u>before </u>it ends by pressing the <b>Stop </b>button?
How can I code the <b>Stop </b>button to stop the Loop?
Another thing that I noticed is that when the loop is operational the buttons are not active till the loop stops.
Please let me know the solution for this.
Thank You.
View the full article
In my windows form there are two buttons , <b>Start</b> and <b>Stop</b>. When i press the <b>Start </b>button a loop (While loop or a foreach or any other loop) starts to execute and it will take some time for it to end.
<div align=left>My question is how to stop the loop <u>before </u>it ends by pressing the <b>Stop </b>button?
How can I code the <b>Stop </b>button to stop the Loop?
Another thing that I noticed is that when the loop is operational the buttons are not active till the loop stops.
Please let me know the solution for this.
Thank You.
View the full article