This documentation is archived and is not being maintained.

Control.ResumeLayout Method

Resumes normal layout logic.

Overload List

Resumes normal layout logic.

[Visual Basic] Overloads Public Sub ResumeLayout()
[C#] public void ResumeLayout();
[C++] public: void ResumeLayout();
[JScript] public function ResumeLayout();

Resumes normal layout logic. Optionally forces an immediate layout of pending layout requests.

[Visual Basic] Overloads Public Sub ResumeLayout(Boolean)
[C#] public void ResumeLayout(bool);
[C++] public: void ResumeLayout(bool);
[JScript] public function ResumeLayout(Boolean);


[Visual Basic, C#, C++] The following example adds two buttons to a form. The example transactions the addition of the buttons by using the SuspendLayout and ResumeLayout methods.

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of ResumeLayout. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Private Sub AddButtons()
   ' Suspend the form layout and add two buttons.
   Dim buttonOK As New Button()
   buttonOK.Location = New Point(10, 10)
   buttonOK.Size = New Size(75, 25)
   buttonOK.Text = "OK"
   Dim buttonCancel As New Button()
   buttonCancel.Location = New Point(90, 10)
   buttonCancel.Size = New Size(75, 25)
   buttonCancel.Text = "Cancel"
   Me.Controls.AddRange(New Control() {buttonOK, buttonCancel})
End Sub

private void AddButtons()
   // Suspend the form layout and add two buttons.
   Button buttonOK = new Button();
   buttonOK.Location = new Point(10, 10);
   buttonOK.Size = new Size(75, 25);
   buttonOK.Text = "OK";

   Button buttonCancel = new Button();
   buttonCancel.Location = new Point(90, 10);
   buttonCancel.Size = new Size(75, 25);
   buttonCancel.Text = "Cancel";
   this.Controls.AddRange(new Control[]{buttonOK, buttonCancel});

    void AddButtons() {
        // Suspend the form layout and add two buttons.
        Button* buttonOK = new Button();
        buttonOK->Location =  Point(10, 10);
        buttonOK->Size =  System::Drawing::Size(75, 25);
        buttonOK->Text = S"OK";

        Button* buttonCancel = new Button();
        buttonCancel->Location =  Point(90, 10);
        buttonCancel->Size =  System::Drawing::Size(75, 25);
        buttonCancel->Text = S"Cancel";
        Control* temp5 [] = {buttonOK, buttonCancel};

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

Control Class | Control Members | System.Windows.Forms Namespace