Control.SuspendLayout Method ()
Temporarily suspends the layout logic for the control.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
The layout logic of the control is suspended until the ResumeLayout method is called.
The ResumeLayout methods are used in tandem to suppress multiple Layout events while you adjust multiple attributes of the control. For example, you would typically call the method, then set the Size, Location, Anchor, or Dock properties of the control, and then call the ResumeLayout method to enable the changes to take effect.and
There must be no pending calls to ResumeLayout to be successfully called.for
When adding several controls to a parent control, it is recommended that you call the ResumeLayout method. This will increase the performance of applications with many controls.method before initializing the controls to be added. After adding the controls to the parent control, call the
Legacy Code Example
The following code example adds two buttons to a form. The example transactions the addition of the buttons by using the ResumeLayout methods.and
Private Sub EnumerateTreeNodes() Dim myNodeCollection As TreeNodeCollection = myTreeView.Nodes ' Check for a node in the collection. If myNodeCollection.Contains(myTreeNode2) Then myLabel.Text += "Node2 is at index: " + myNodeCollection.IndexOf(myTreeNode2) End If myLabel.Text += ControlChars.Cr + ControlChars.Cr + _ "Elements of the TreeNodeCollection:" + ControlChars.Cr ' Create an enumerator for the collection. Dim myEnumerator As IEnumerator = myNodeCollection.GetEnumerator() While myEnumerator.MoveNext() myLabel.Text += CType(myEnumerator.Current, TreeNode).Text + ControlChars.Cr End While End Sub
Available since 1.1