Pause program while executing a c#code

Asked

Viewed 157 times

0

I am in doubt in the use of threads, I want that, in a given time, the program stops responding and only comes back when I determine...

Example:

System.Threading.Thread.Pausa();

// Executa código

System.Threading.Thread.VoltaDnv();

How do I do that?

  • If I understand correctly, you want to lock the program. That’s right?

  • If he’ll be standing still like he’ll know when to come back?

  • It seems to me that you want to do some competition control... If so, there are alternatives ready and well thought out for this.

  • It will know when to come back when you go to System.Threading.Thread.Voltadnv(); which is when you finish the lines of code in the // Run code

  • So, by clicking the button, the program will lock and be resized, and after being resized, it will unlock

  • 2

    If it is paused, how will you get there? It is better to explain what you want, because it seems that this is the wrong mechanism for the task.

  • When I download a file, does the program not lock and unlock when it finishes downloading? Of course, not in the asynchronous method. Got it?

  • Please edit your question by putting an example, so it will be simpler to understand.

  • You’re trying to do this the wrong way.. This pausing to do another task... has to be an asynchronous one. What’s wrong with using async? or Background worker that is?

Show 4 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.