How to break out of a loop depending on a CheckBox Checked value while the loop is running?
- by Rayner Vaz
Lets say I want to call a function repeatedly if the user selects a CheckBox named "repeat" but the calls to the function should stop as soon as the user 'unchecks' the CheckBox.
I tried using the 'Checked', 'Click' and 'Tap' event of the CheckBox but once the loop starts, it does not sense any changes in the checkbox's state.
I even tried using a loop inside another button's _Click method, but then that creates a lock on the Button's 'pressed' state.
Any ideas/alternate suggestions?