dotnetmonitor.com

 
Index
Previous
Next

 

In the UI that you believe to be laying out the most, either override OnLayout or sync the Layout event. In the event use Debug WriteLines to write both the current size of the control and the call stack of how we got here. You can also print out the layoutEventArgs.AffectedProperty. Usually you'll find very interesting results.

 

For the scenarios where you think the Layout is not necessary, add in a SuspendLayout. When the operation is complete, add a matching ResumeLayout. If you dont feel that a layout is necessary at that time, call ResumeLayout(false) which means dont do the layout just this second

Terms
Docking Anchor Layout
What happens when I have Dock and Anchors that conflict?
Dock Scenarios
Padding Margin