Control.ResumeLayout Control.ResumeLayout Control.ResumeLayout Control.ResumeLayout Method

定義

繼續平常的配置邏輯。Resumes the usual layout logic.

多載

ResumeLayout() ResumeLayout() ResumeLayout() ResumeLayout()

繼續平常的配置邏輯。Resumes usual layout logic.

ResumeLayout(Boolean) ResumeLayout(Boolean) ResumeLayout(Boolean) ResumeLayout(Boolean)

繼續平常的配置邏輯,選擇性地強制暫止配置要求的立即配置。Resumes usual layout logic, optionally forcing an immediate layout of pending layout requests.

ResumeLayout() ResumeLayout() ResumeLayout() ResumeLayout()

繼續平常的配置邏輯。Resumes usual layout logic.

public:
 void ResumeLayout();
public void ResumeLayout ();
member this.ResumeLayout : unit -> unit
Public Sub ResumeLayout ()

範例

下列程式碼範例會將兩個按鈕加入至表單。The following code example adds two buttons to a form. 範例交易使用按鈕的加法SuspendLayoutResumeLayout方法。The example transactions the addition of the buttons by using the SuspendLayout and ResumeLayout methods.

private:
   void AddButtons()
   {
      // Suspend the form layout and add two buttons.
      this->SuspendLayout();
      Button^ buttonOK = gcnew Button;
      buttonOK->Location = Point(10,10);
      buttonOK->Size = System::Drawing::Size( 75, 25 );
      buttonOK->Text = "OK";
      Button^ buttonCancel = gcnew Button;
      buttonCancel->Location = Point(90,10);
      buttonCancel->Size = System::Drawing::Size( 75, 25 );
      buttonCancel->Text = "Cancel";
      array<Control^>^temp5 = {buttonOK,buttonCancel};
      this->Controls->AddRange( temp5 );
      this->ResumeLayout();
   }
private void AddButtons()
{
   // Suspend the form layout and add two buttons.
   this.SuspendLayout();
   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});
   this.ResumeLayout();
}
Private Sub AddButtons()
   ' Suspend the form layout and add two buttons.
   Me.SuspendLayout()
   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})
   Me.ResumeLayout()
End Sub

備註

呼叫ResumeLayout方法會強制立即配置,如有任何暫止配置要求。Calling the ResumeLayout method forces an immediate layout if there are any pending layout requests.

SuspendLayoutResumeLayout方法一起用來隱藏多個Layout事件,當您調整多個控制項的屬性。The SuspendLayout and ResumeLayout methods are used in tandem to suppress multiple Layout events while you adjust multiple attributes of the control. 例如,您通常會呼叫SuspendLayout方法,然後將SizeLocationAnchor,或Dock屬性,以及與的控制項,然後呼叫ResumeLayout方法,讓變更生效。For example, you would typically call the SuspendLayout 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.

必須有任何暫止呼叫SuspendLayout針對ResumeLayout成功呼叫。There must be no pending calls to SuspendLayout for ResumeLayout to be successfully called.

另請參閱

ResumeLayout(Boolean) ResumeLayout(Boolean) ResumeLayout(Boolean) ResumeLayout(Boolean)

繼續平常的配置邏輯,選擇性地強制暫止配置要求的立即配置。Resumes usual layout logic, optionally forcing an immediate layout of pending layout requests.

public:
 void ResumeLayout(bool performLayout);
public void ResumeLayout (bool performLayout);
member this.ResumeLayout : bool -> unit
Public Sub ResumeLayout (performLayout As Boolean)

參數

performLayout
Boolean Boolean Boolean Boolean

true 以執行暫止配置要求,否則為 falsetrue to execute pending layout requests; otherwise, false.

備註

呼叫ResumeLayout方法會強制立即配置,如有任何暫止配置要求。Calling the ResumeLayout method forces an immediate layout if there are any pending layout requests. performLayout參數設為true,如果有任何暫止配置要求,就會發生立即配置。When the performLayout parameter is set to true, an immediate layout occurs if there are any pending layout requests.

SuspendLayoutResumeLayout方法一起用來隱藏多個Layout事件,當您調整多個控制項的屬性。The SuspendLayout and ResumeLayout methods are used in tandem to suppress multiple Layout events while you adjust multiple attributes of the control. 例如,您通常會呼叫SuspendLayout方法,然後將SizeLocationAnchor,或Dock屬性,以及與的控制項,然後呼叫ResumeLayout方法,讓變更生效。For example, you would typically call the SuspendLayout 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.

必須有任何暫止呼叫SuspendLayout針對ResumeLayout成功呼叫。There must be no pending calls to SuspendLayout for ResumeLayout to be successfully called.

注意

將數個控制項加入至父控制項中,建議您呼叫SuspendLayout方法之前初始化要加入的控制項。When adding several controls to a parent control, it is recommended that you call the SuspendLayout method before initializing the controls to be added. 之後將控制項加入至父控制項,呼叫ResumeLayout方法。After adding the controls to the parent control, call the ResumeLayout method. 這會增加具有許多控制項的應用程式的效能。This will increase the performance of applications with many controls.

另請參閱

適用於