Re: Pausing a process without holding OS by surturz
surturz
Tue Jul 15 01:13:00 CDT 2008
Application.DoEvents() is probably the easiest way. You need to disable all
your controls so you don't get cascading events.
For example,
Me.Enabled = False
Application.DoEvents()
Me.Enabled = True
--
David Streeter
Synchrotech Software
Sydney Australia
"Armin Zingler" wrote:
> "John" <info@nospam.infovis.co.uk> schrieb
> > Hi
> >
> > I need to add pauses in-between processes in my app to give time to
> > other users/processes on the network. Is there a way to pass control
> > to OS for a specified time (say 15 seconds) to delay my app but at
> > the same time not blocking OS's processor cycles?
>
> Threading.Thread.Sleep(15000)
>
>
>
> If the thread has a UI, it's better not to Sleep because it locks the UI.
> - Instead you should set a Timer and do whatever in 15 seconds
> - Or, do whatever has to be done in another thread (including Sleep). Then I
> also suggest not to sleep for 15 seconds but only max 1 second (for example)
> in a loop in order to be able to react to cancel requests.
>
>
> Armin
>
>