Control.ResumeLayout Método

Definição

Retoma a lógica de layout usual.Resumes the usual layout logic.

Sobrecargas

ResumeLayout()

Retoma a lógica de layout usual.Resumes usual layout logic.

ResumeLayout(Boolean)

Retoma a lógica de layout usual, opcionalmente, forçando um layout imediato de solicitações de layout pendentes.Resumes usual layout logic, optionally forcing an immediate layout of pending layout requests.

ResumeLayout()

Retoma a lógica de layout usual.Resumes usual layout logic.

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

Exemplos

O exemplo de código a seguir adiciona dois botões a um formulário.The following code example adds two buttons to a form. O exemplo Transactions a adição dos botões usando os métodos SuspendLayout e ResumeLayout.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

Comentários

Chamar o método ResumeLayout forçará um layout imediato se houver solicitações de layout pendentes.Calling the ResumeLayout method forces an immediate layout if there are any pending layout requests.

Os métodos SuspendLayout e ResumeLayout são usados em tandem para suprimir vários eventos Layout enquanto você ajusta vários atributos do controle.The SuspendLayout and ResumeLayout methods are used in tandem to suppress multiple Layout events while you adjust multiple attributes of the control. Por exemplo, você normalmente chamaria o método SuspendLayout e, em seguida, definiu as propriedades Size, Location, Anchor ou Dock do controle e, em seguida, chamaria o método ResumeLayout para permitir que as alterações entrem em vigor.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.

Não deve haver nenhuma chamada pendente para SuspendLayout para que ResumeLayout seja chamado com êxito.There must be no pending calls to SuspendLayout for ResumeLayout to be successfully called.

Veja também

ResumeLayout(Boolean)

Retoma a lógica de layout usual, opcionalmente, forçando um layout imediato de solicitações de layout pendentes.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)

Parâmetros

performLayout
Boolean

true para executar solicitações de layout pendentes; caso contrário, false.true to execute pending layout requests; otherwise, false.

Comentários

Chamar o método ResumeLayout forçará um layout imediato se houver solicitações de layout pendentes.Calling the ResumeLayout method forces an immediate layout if there are any pending layout requests. Quando o parâmetro performLayout for definido como true, um layout imediato ocorrerá se houver solicitações de layout pendentes.When the performLayout parameter is set to true, an immediate layout occurs if there are any pending layout requests.

Os métodos SuspendLayout e ResumeLayout são usados em tandem para suprimir vários eventos Layout enquanto você ajusta vários atributos do controle.The SuspendLayout and ResumeLayout methods are used in tandem to suppress multiple Layout events while you adjust multiple attributes of the control. Por exemplo, você normalmente chamaria o método SuspendLayout e, em seguida, definiu as propriedades Size, Location, Anchor ou Dock do controle e, em seguida, chamaria o método ResumeLayout para permitir que as alterações entrem em vigor.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.

Não deve haver nenhuma chamada pendente para SuspendLayout para que ResumeLayout seja chamado com êxito.There must be no pending calls to SuspendLayout for ResumeLayout to be successfully called.

Observação

Ao adicionar vários controles a um controle pai, é recomendável chamar o método SuspendLayout antes de inicializar os controles a serem adicionados.When adding several controls to a parent control, it is recommended that you call the SuspendLayout method before initializing the controls to be added. Depois de adicionar os controles ao controle pai, chame o método ResumeLayout.After adding the controls to the parent control, call the ResumeLayout method. Isso aumentará o desempenho dos aplicativos com muitos controles.This will increase the performance of applications with many controls.

Veja também

Aplica-se a