doing other things while the program in loop

  • Thread starter Thread starter 2003et
  • Start date Start date
2

2003et

I want to show the number on the screen, while the program is in loop, at
real time...

But the program shows the number after loop ends... My program do nothing
before loop ends...

How can I prevent this? I don't want my program to stall while it is in
loop...

Thank you...
 
2003et said:
I want to show the number on the screen, while the program is in loop, at
real time...

But the program shows the number after loop ends... My program do nothing
before loop ends...

How can I prevent this? I don't want my program to stall while it is in
loop...

You should put the work loop in another thread, and update the UI
periodically. However, you should use Control.Invoke to make sure that
you don't actually make the change to the UI from the worker thread -
you should only ever modify the UI from the UI's own thread.
 
Back
Top