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?
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();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With