Carlzj2016.01.31 02:33 questions
- C# click the first button to click a button to stop the cycle, second cycles
C#. I set two button, click the first button of a cycle, click the second button to stop the cycle, but regardless of how to deal with the first button press are a dead loop, the program presents the locked state, how to solve the?
The 3 answer
- Caozhy 2016.01.31 06:28
- Has adopted
When you add the cycle
- U013538542 2016.01.31 13:05
A button at the start of an infinite loop, will the death card interface, because this cycle is executed on the main thread,
Do you require LZ functions need to use multiple threads, the first button to start a thread, the thread executes for cycle
Second, a button to stop the thread that stop the cycle
- Duwucanglan 2016.01.31 07:01
With multi thread ah, button1 boot loop thread, button2 stop
- Excuse me: create a new project and add the two text box and a button. Write code to implement: click the button, the first text box text in the second text box.