Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi ppl

 

I have created an app that does quite a bit of processing.

My trouble is that when I press the process button, the window will often go blank (especially if you change to another window, and get then back to this app), and the objects don't get refreshed.

 

I tried using this.Refresh() which they say "forces the control to invalidate its client area and immediately redraw itself and any child controls", but it didn't work all that well. At least not as I expected...

 

Is there a simple way to force the window to refresh from time to time, say every x cycles in the main loop?

 

thanks

Ricardo

  • Leaders
Posted
Another possibility would be to do processing on another thread so that the GUI thread doesn't get tied up (search MSDN for info about the Thread class).
[sIGPIC]e[/sIGPIC]
Posted

I know this is a bit late, but here's a pretty good example of how to execute a long loop in a different thread.

 

Website Link

 

This will prevent the GUI from freezing up.

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...