Control.ResumeLayout メソッド

定義

通常のレイアウト ロジックを再開します。

オーバーロード

ResumeLayout()

通常のレイアウト ロジックを再開します。

ResumeLayout(Boolean)

通常のレイアウト ロジックを再開します。オプションで、保留中のレイアウト要求のレイアウトを強制的に即時実行します。

ResumeLayout()

通常のレイアウト ロジックを再開します。

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

次のコード例では、フォームに 2 つのボタンを追加します。 この例では、 メソッドと ResumeLayout メソッドを使用して、ボタンの追加をSuspendLayoutトランザクションします。

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 レイアウト要求がある場合は、 メソッドを呼び出すと、即時レイアウトが強制されます。

SuspendLayoutメソッドと ResumeLayout メソッドは、コントロールの複数の属性を調整しながら、複数Layoutのイベントを抑制するために並行して使用されます。 たとえば、通常は メソッドを SuspendLayout 呼び出し、コントロールの SizeLocationAnchor、または Dock プロパティを設定してから、 メソッドを ResumeLayout 呼び出して変更を有効にします。

に対する SuspendLayout 保留中の ResumeLayout 呼び出しを正常に呼び出す必要はありません。

こちらもご覧ください

適用対象

ResumeLayout(Boolean)

通常のレイアウト ロジックを再開します。オプションで、保留中のレイアウト要求のレイアウトを強制的に即時実行します。

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

パラメーター

performLayout
Boolean

保留中のレイアウトの要求を実行する場合は true。それ以外の場合は false

注釈

保留中の ResumeLayout レイアウト要求がある場合は、 メソッドを呼び出すと、即時レイアウトが強制されます。 パラメーターが performLayouttrue設定されている場合、保留中のレイアウト要求がある場合は、即時レイアウトが発生します。

SuspendLayoutメソッドと ResumeLayout メソッドは、コントロールの複数の属性を調整しながら、複数Layoutのイベントを抑制するために並行して使用されます。 たとえば、通常は メソッドを SuspendLayout 呼び出し、コントロールの SizeLocationAnchor、または Dock プロパティを設定してから、 メソッドを ResumeLayout 呼び出して変更を有効にします。

に対する SuspendLayout 保留中の ResumeLayout 呼び出しを正常に呼び出す必要はありません。

Note

親コントロールに複数のコントロールを追加する場合は、追加するコントロールを SuspendLayout 初期化する前に メソッドを呼び出することをお勧めします。 コントロールを親コントロールに追加した後、 メソッドを呼び出します ResumeLayout 。 これにより、多くのコントロールを持つアプリケーションのパフォーマンスが向上します。

こちらもご覧ください

適用対象