Reputation: 85
I have a program I wrote in C# with a window that contain a groupBox with image.
I have a button that do some things (it doesn't matter what exactly) and it refresh the window in his loop (in button_click function) (with this.Refresh();).
Does there is a way that I can refresh the window without refreshing the groupBox?
*I have another problem, I cant minimize the window while the button_click function working. there is something I can do to solve it?
Upvotes: 3
Views: 406
Reputation: 16162
Use Invalidate() instead of Refresh()
this.Invalidate(false);//false to not redraw the controls in the form.
Edit: msdn
Calling the Invalidate method does not force a synchronous paint; to force a synchronous paint, call the Update method after calling the Invalidate method
so:
this.Invalidate(false);
this.Update();
Upvotes: 2