L
L
lexa_gorchakov192018-10-26 16:39:39
C++ / C#
lexa_gorchakov19, 2018-10-26 16:39:39

How to exit the loop when the checkbox is cleared?

I have a script:
When I enable a checkbox, a loop starts.
And c# does not allow me to turn off the checkbox because there is always a cycle, how to fix it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
ttlscr, 2018-10-26
@lexa_gorchakov19

Use System.Threading.Threadto run your loop on a separate thread. In general, multithreading is a separate topic, you will also have to learn Mutex's in order for threads to safely access shared data.

L
LiptonOlolo, 2018-10-26
@LiptonOlolo

Use async/await

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question