Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
How can I use a button to break out of a while loop?
[b][red]This message was edited by paulhaynes at 2007-3-25 19:18:31[/red][/b][hr]
*** MESSAGE HAS BEEN REPOSTED IN THE WINDOWS PROGRAMMING SECTION ***
This seems like a simple thing to accomplish but I cannot get it figured out.
I'm running a while loop that is started by a button's OnClick event. I want to use another button's OnClick event to break out of the while loop started by the first button.
//Code goes here
bContinueLooping = false;
Clicking Button1 causes the loop to start.
Clicking Button2 causes the loop to end.
The problem is that as long as the while loop is running, Button2 doesn't get recognized.
Anyone know how to break out of a while loop using this "press a button to exit" method or have a suggestion for a better way to handle it?
This is a 32-bit Windows program.
0 · ·