Form.Size プロパティとは? わかりやすく解説

Form.Size プロパティ

フォームサイズ取得または設定します

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

<LocalizableAttribute(False)> _
Public Property Size As
 Size
Dim instance As Form
Dim value As Size

value = instance.Size

instance.Size = value
[LocalizableAttribute(false)] 
public Size Size { get; set;
 }
[LocalizableAttribute(false)] 
public:
property Size Size {
    Size get ();
    void set (Size value);
}
/** @property */
public Size get_Size ()

/** @property */
public void set_Size (Size value)

プロパティ
フォームサイズを表す Size

解説解説
使用例使用例

不透明度 75% で表示されるフォーム作成する方法次のコード例示します。このコード例では、新しフォーム画面中央作成しOpacity プロパティ設定してフォーム不透明度変更しますまた、既定サイズフォームより大きなフォーム作成するように、Size プロパティ設定します。この例は、この例で定義されているメソッド別のフォームからイベント ハンドラか他のメソッド呼び出されることを前提にしています。

Private Sub CreateMyOpaqueForm()
   ' Create a new form.
   Dim form2 As New Form()
   ' Set the text displayed in the caption.
   form2.Text = "My Form"
   ' Set the opacity to 75%.
   form2.Opacity = 0.75
   ' Size the form to be 300 pixels in height and width.
   form2.Size = New Size(300, 300)
   ' Display the form in the center of the screen.
   form2.StartPosition = FormStartPosition.CenterScreen

   ' Display the form as a modal dialog box.
   form2.ShowDialog()
End Sub
private void CreateMyOpaqueForm()
{
   // Create a new form.
   Form form2 = new Form();
   // Set the text displayed in the caption.
   form2.Text = "My Form";
   // Set the opacity to 75%.
   form2.Opacity = .75;
   // Size the form to be 300 pixels in height and width.
   form2.Size = new Size(300,300);
   // Display the form in the center of the screen.
   form2.StartPosition = FormStartPosition.CenterScreen;

   // Display the form as a modal dialog box.
   form2.ShowDialog();
}
private:
   void CreateMyOpaqueForm()
   {
      // Create a new form.
      Form^ form2 = gcnew Form;

      // Set the text displayed in the caption.
      form2->Text = "My Form";

      // Set the opacity to 75%.
      form2->Opacity = .75;

      // Size the form to be 300 pixels in height and width.
      form2->Size = System::Drawing::Size( 300, 300 );

      // Display the form in the center of the screen.
      form2->StartPosition = FormStartPosition::CenterScreen;

      // Display the form as a modal dialog box.
      form2->ShowDialog();
   }
private void CreateMyOpaqueForm()
{
    // Create a new form.
    Form form2 = new Form();

    // Set the text displayed in the caption.
    form2.set_Text("My Form");

    // Set the opacity to 75%.
    form2.set_Opacity(0.75);

    // Size the form to be 300 pixels in height and width.
    form2.set_Size(new Size(300, 300));

    // Display the form in the center of the screen.
    form2.set_StartPosition(FormStartPosition.CenterScreen);

    // Display the form as a modal dialog box.
    form2.ShowDialog();
} //CreateMyOpaqueForm
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「Form.Size プロパティ」の関連用語

Form.Size プロパティのお隣キーワード
検索ランキング

   

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



Form.Size プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS