Control.Layout イベントとは? わかりやすく解説

Control.Layout イベント

コントロールの子コントロール位置変更する必要があるときに発生します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Event Layout As LayoutEventHandler
Dim instance As Control
Dim handler As LayoutEventHandler

AddHandler instance.Layout, handler
public event LayoutEventHandler Layout
public:
event LayoutEventHandler^ Layout {
    void add (LayoutEventHandler^ value);
    void remove (LayoutEventHandler^ value);
}
/** @event */
public void add_Layout (LayoutEventHandler
 value)

/** @event */
public void remove_Layout (LayoutEventHandler
 value)
JScript では、イベント使用できますが、新規に宣言することはできません。
解説解説
使用例使用例

Layout イベント画面中央Form配置するコード例次に示します。これにより、ユーザーフォームサイズ変更しても、フォーム中央配置されます。この例では、Form コントロールが既に作成されている必要があります

Private Sub MyForm_Layout(ByVal
 sender As Object, _
    ByVal e As System.Windows.Forms.LayoutEventArgs)
 Handles MyBase.Layout

    ' Center the Form on the user's screen everytime it requires a Layout.
    Me.SetBounds((System.Windows.Forms.Screen.GetBounds(Me).Width
 / 2) - (Me.Width / 2), _
        (System.Windows.Forms.Screen.GetBounds(Me).Height / 2)
 - (Me.Height / 2), _
        Me.Width, Me.Height, System.Windows.Forms.BoundsSpecified.Location)
End Sub
private void MyForm_Layout(object sender, System.Windows.Forms.LayoutEventArgs
 e)
{
   // Center the Form on the user's screen everytime it requires a Layout.
   this.SetBounds((Screen.GetBounds(this).Width/2)
 - (this.Width/2),
       (Screen.GetBounds(this).Height/2) - (this.Height/2)
,
       this.Width, this.Height, BoundsSpecified.Location);
    
}
private:
   void MyForm_Layout( Object^ /*sender*/, System::Windows::Forms::LayoutEventArgs^
 /*e*/ )
   {
      // Center the Form on the user's screen everytime it requires
 a Layout.
      this->SetBounds( (Screen::GetBounds( this
 ).Width / 2) - (this->Width / 2), (Screen::GetBounds( this
 ).Height / 2) - (this->Height / 2), this->Width, this->Height, BoundsSpecified::Location );
   }
private void MyForm_Layout(Object sender, 
    System.Windows.Forms.LayoutEventArgs e)
{
    // Center the Form on the user's screen everytime it requires a
 Layout.
    this.SetBounds(Screen.GetBounds(this).get_Width()
 
        / 2 - this.get_Width() / 2, Screen.GetBounds(this).get_Height()
 
        / 2 - this.get_Height() / 2, this.get_Width(),
 this.get_Height(), 
        BoundsSpecified.Location);
} //MyForm_Layout
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Control クラス
Control メンバ
System.Windows.Forms 名前空間
OnLayout
InitLayout
SuspendLayout
ResumeLayout
Control.LayoutEngine プロパティ
Control.Layout イベント
PerformLayout


このページでは「.NET Framework クラス ライブラリ リファレンス」からControl.Layout イベントを検索した結果を表示しています。
Weblioに収録されているすべての辞書からControl.Layout イベントを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からControl.Layout イベント を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Control.Layout イベント」の関連用語

Control.Layout イベントのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Control.Layout イベントのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS