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

Control.Resize イベント

コントロールサイズ変更される発生します

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

解説解説
使用例使用例

FormResize イベント処理するコード例次に示しますフォームサイズ変更されるとき、そのフォームイベント ハンドラによって正方形保たれます。つまり HeightWidth等しい値のままになります

Private Sub Form1_Resize(ByVal
 sender As System.Object, ByVal e As
 System.EventArgs) Handles MyBase.Resize

   Dim myControl As Control
   myControl = sender

   ' Ensure the Form remains square (Height = Width).
   If myControl.Size.Height <> myControl.Size.Width Then
      myControl.Size = New Size(myControl.Size.Width, myControl.Size.Width)
   End If
End Sub
private void Form1_Resize(object sender, System.EventArgs
 e)
{
   Control control = (Control)sender;
        
   // Ensure the Form remains square (Height = Width).
   if(control.Size.Height != control.Size.Width)
   {
      control.Size = new Size(control.Size.Width, control.Size.Width);
   }
}
private:
   void Form1_Resize( Object^ sender, System::EventArgs^ /*e*/
 )
   {
      Control^ control = dynamic_cast<Control^>(sender);

      // Ensure the Form remains square (Height = Width).
      if ( control->Size.Height != control->Size.Width )
      {
         control->Size = System::Drawing::Size( control->Size.Width, control->Size.Width
 );
      }
   }
private void Form1_Resize(Object sender, System.EventArgs
 e)
{
    Control control = (Control)sender;
    // Ensure the Form remains square (Height = Width).
    if (control.get_Size().get_Height() != control.get_Size().
        get_Width()) {
        control.set_Size(new Size(control.get_Size().get_Width()
,
            control.get_Size().get_Width()));
    }
} //Form1_Resize
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

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

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

   

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



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

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

©2025 GRAS Group, Inc.RSS