Busy .NET control repaint color

  • Thread starter Alberto Bencivenni
  • Start date
A

Alberto Bencivenni

Hi All,

Did you ever see a control very busy doing something: yes it is
usually completely white and the wait cursor is spinning.

We are looking for a trick to change the solid white color with the
parent background color. We tried changing the BackColor to something
different but didn't help.

Any idea?

Thanks,

Alberto
 
M

Marc Bernard

Hi All,

Did you ever see a control very busy doing something: yes it is
usually completely white and the wait cursor is spinning.

We are looking for a trick to change the solid white color with the
parent background color. We tried changing the BackColor to something
different but didn't help.

Any idea?

Thanks,

Alberto


It's completely white because it's too busy to handle painting itself.

I think you'd be better off figuring out how to do the busy work
without blocking the UI thread.

Marc
http://nomagichere.blogspot.com
 
A

Alberto Bencivenni

Hi Guys,

Sorry for the delay but I lost this first post.

We can't help the control because it is interacting in a complex
infrastructure.

Just wanted to know if there is a way to do it. If we set the form
background color to Gray we get the form filled in black... Why?!?

Thanks,

Alberto
 
A

Alberto Bencivenni

Glen,

The DoEvents suggestion is nice, what happend if we call
Application.DoEvent from inside a UserControl DLL: will it flush only
the DLL events or all the application ones?

Suppose you are filling a listbox with millions of items, what happens
if you call Application.DoEvents every AddItem? Will the speed
decrease considerably?

Thanks,

Alberto
 
F

Family Tree Mike

Alberto Bencivenni said:
Glen,

The DoEvents suggestion is nice, what happend if we call
Application.DoEvent from inside a UserControl DLL: will it flush only
the DLL events or all the application ones?

Suppose you are filling a listbox with millions of items, what happens
if you call Application.DoEvents every AddItem? Will the speed
decrease considerably?

Thanks,

Alberto


If you are filling a listbox with millions of items, then look at
ListBox.BeginUpdate & ListBox.EndUpdate. I would question whether a user
can select an item adequately well from a listbox with a million items.
 
A

Alberto Bencivenni

Mike,

The listbox was an example, of course. BTW, it looks like a provident
usage of DoEvents will help a lot.

Thanks again for the suggestion.

Alberto
 

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