Application pausing: sleep or timers?

B

BLUE

I would like to pause an application while the GUI display a Label saying
"Logging in...".

System.Timers
System.Windows.Forms.Timer
System.Threading.Timer
System.Threading ==> Thread.Sleep

Which one?
In the last case Sleep must be applied to what(Application, this or what)?


Thanks,
Luigi.
 
A

Alberto Poblacion

BLUE said:
I would like to pause an application [...]Thread.Sleep

Which one?
In the last case Sleep must be applied to what(Application, this or what)?

Thread.Sleep is most adequate for pausing the aplication. "Sleep" is a
static method of the class System.Threading.Thread, so you just invoke it as
System.Threading.Thread.Sleep(milliseconds), and you don't "apply" it to
anything. Internally it gets applied to the current thread.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,


BLUE said:
I would like to pause an application while the GUI display a Label saying
"Logging in...".

Are you sure you want to pause the appp?

That means that NOTHING is executed in the app while it's paused.


I think that what you want is to display a Splash screen while you load your
app.

If this is so take a look in the archives, there are a lot of examples of
how to implement one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top