Busy control fill color

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
 
F

Family Tree Mike

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?
 
S

Stanimir Stoyanov

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.
 
A

Alberto Bencivenni

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
 
S

Stanimir Stoyanov

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.
 
A

Alberto Bencivenni

Stanimir,

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

Thanks,

Alberto
 
L

Leon Lambert

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
 

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

Top