Paint problem in windows form

  • Thread starter Thread starter dbcuser
  • Start date Start date
D

dbcuser

Hi,

I have a small windows form. This has 2 labels and a button. When a
user presses a button, I copy a large file. Nowwhen the copy is going
on, if I switch windows, my main window becomes white. How can I retain
the values of the screen when switching between the windows?

Thanks.
 
Well that make sense. But I remember reading (I think it was game
programming in c#) that there is a method that get invoked every time
the windows switch happen or something or repaint and all you have to
do is repaint all the elements, I am not sure. Well, I will search, if
nothing work out I will take the async approach.

Thanks.
 
Well that make sense. But I remember reading (I think it was game
programming in c#) that there is a method that get invoked every time
the windows switch happen or something or repaint and all you have to
do is repaint all the elements, I am not sure. Well, I will search, if
nothing work out I will take the async approach.

The thread is probably the preferred method but if you are copying chunks at
a time using a filestream you can just put an Application.DoEvents in there.

Michael
 
Well that make sense. But I remember reading (I think it was game
programming in c#) that there is a method that get invoked every time
the windows switch happen or something or repaint and all you have to
do is repaint all the elements, I am not sure. Well, I will search, if
nothing work out I will take the async approach.

Well, the method which gets invoked when you swith windows is form.activate/form.deactivate which
you can wire and call Invalidate() on the form. I doubt it would help you as copying might involve
lots of resources. I would go for a async copying.

Thank you
Andrey
 
Back
Top