Busy control fill color

  • Thread starter Thread starter Alberto Bencivenni
  • Start date Start date
A

Alberto Bencivenni

Hi All,


Did you ever see a control very busy doing something? Yes, it is
completely white and the wait cursor is spinning.

We want to change the white color with somethign else, is it possible
someway?

Thanks,

Alberto
 
Alberto Bencivenni said:
Hi All,


Did you ever see a control very busy doing something? Yes, it is
completely white and the wait cursor is spinning.

We want to change the white color with somethign else, is it possible
someway?

Thanks,

Alberto


Did you try the suggestions to your previous post?
 
Alberto,

You can look into splitting the work of your application into threads. This
will ensure that the UI of the control will continue to be rendered while
the actual CPU-intensive work is off-loaded. Here is an article, which will
give you a low-level insight on threading:
http://www.codeproject.com/KB/threads/threadinginnet.aspx, while
http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx
explores the BackgroundWorker component which gives a high-end interface for
you to use.
 
Stanimir,

The busy work is just in repaint so there is no way to put everything
on a different thread...

Any other option or article that explain in details what happens in
these situations?

Thanks,

Alberto
 
You might want to consider optimizing the repainting. Why exactly is the
repaint process so CPU-intensive?

If you could include an appropriate code excerpt, we could give more
accurate suggestions.
 
Stanimir,

It has to do with OpenGL that it tight to window Handle, so there
isn;t much to do.

Thanks,

Alberto
 
Apply gamer techniques. Do your drawing into an off screen bitmap and
just have you paint routine use the off screen bitmap to update the on
screen one. Following is what my paint routine looks like in the
animated map program i made.

// The map handler draws everything into a bit map on a rate
// The control just bit blitz it here.
private void MapControl_Paint(object
sender,System.Windows.Forms.PaintEventArgs e)
{
Bitmap map = mapHandler.Map; // get off screen bitmap
if(map != null)
e.Graphics.DrawImage(map,0,0,map.Width,map.Height);
}

Hope that helps.
Leon Lambert
 
Back
Top