System.Windows.Forms.Control.SuspendLayout Method

Temporarily suspends the layout logic for the control.

Syntax

public void SuspendLayout ()

Remarks

The layout logic of the control is suspended until the Control.ResumeLayout method is called.

The Control.SuspendLayout and Control.ResumeLayout methods are used in tandem to suppress multiple Control.Layout events while you adjust multiple attributes of the control. For example, you would typically call the Control.SuspendLayout method, then set the Control.Size, Control.Location, Control.Anchor, or Control.Dock properties of the control, and then call the Control.ResumeLayout method to enable the changes to take effect.

There must be no pending calls to Control.SuspendLayout for Control.ResumeLayout to be successfully called.

Note:

When adding several controls to a parent control, it is recommended that you call the Control.SuspendLayout method before initializing the controls to be added. After adding the controls to the parent control, call the Control.ResumeLayout method. This will increase the performance of applications with many controls.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0