英語で読む

次の方法で共有


FormWindowState 列挙型

定義

フォーム ウィンドウの表示方法を指定します。

C#
[System.Runtime.InteropServices.ComVisible(true)]
public enum FormWindowState
C#
public enum FormWindowState
継承
FormWindowState
属性

フィールド

Maximized 2

最大化されたウィンドウ。

Minimized 1

最小化されたウィンドウ。

Normal 0

既定サイズのウィンドウ。

この例では、フォームのウィンドウの状態を変更し、ラベルを Maximized 使用して状態情報を表示します。 この例では、既に Form 名前付き Form1.

C#
public void InitMyForm()
{
    // Adds a label to the form.
    Label label1 = new Label();
    label1.Location = new System.Drawing.Point(54, 128);
    label1.Name = "label1";
    label1.Size = new System.Drawing.Size(220, 80);
    label1.Text = "Start position information";
    this.Controls.Add(label1);

    // Changes the window state to Maximized.
    WindowState = FormWindowState.Maximized;
    // Displays the state information.
    label1.Text = "The form window is " + WindowState;	
}

注釈

この列挙は、Form クラスで使用します。 フォームのさまざまな状態を表します。 既定の状態は Normal.

適用対象

製品 バージョン
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8
Windows Desktop 3.0, 3.1, 5, 6, 7