问题
What windows message or event can i listen to in order to stop a window from being redrawing every pixel of it's resize?
That is, when a user clicks on the edge of the window and starts to re-size it, i don't want to re-draw the entire contents until he lets go. This is because for some reason it's currently choppy at resizing probably because everything is re-docking and what not.
I tried WM_SIZING but that only tells me it's being re-sized, i wish to know the start and end of the sizing so i can suspend the layout until the user stops resizing.
回答1:
Nevermind, just found these two events.
this.ResizeBegin += (s, e) => { this.SuspendLayout(); };
this.ResizeEnd += (s, e) => { this.ResumeLayout(true); };
Works a treat
来源:https://stackoverflow.com/questions/2353381/prevent-window-redraw-when-resizing-c-sharp-windows-forms