Can I pause without starting in a thread (in a forever loop)?

  • Thread starter Thread starter trint
  • Start date Start date
T

trint

I need to know what the safest way to loop(without starting off in a
new thread since UI controls are involved) is...and how to
pause in the loop so that the program runs normally.
Any help is appreciated.
Thanks,
Trint
 
trint said:
I need to know what the safest way to loop(without starting off in a
new thread since UI controls are involved) is...and how to
pause in the loop so that the program runs normally.

Unless your code is pretty much *purely* UI calls, you should use a
thread, and use Control.Invoke to marshall calls back to the UI when
you need to.

If you really are doing a huge amount of work that's just UI calls, you
could use Application.DoEvents, but personally I'd try to avoid that
and use another thread.
 
Jon,
I am making mostly calls to controls and each loop will open, read and
close sql server 2000 4 times. I wish that I felt more comfortable
with threads, which are great for non UI calls, that use
control.invoke.
Any ideas?
Thanks,
Trint
 

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

Back
Top