This documentation is archived and is not being maintained.

FormWindowState Enumeration

Specifies how a form window is displayed.

[Visual Basic]
Public Enum FormWindowState
public enum FormWindowState
__value public enum FormWindowState
enum FormWindowState


This enumeration is used by the Form class. It represents the different states of the form. The default state is Normal.


Member name Description

Supported by the .NET Compact Framework.

A maximized window.
Minimized A minimized window.

Supported by the .NET Compact Framework.

A default sized window.


[Visual Basic, C#, C++] In this example, you change the form's window state to Maximized and display the state information using a label. This example assumes that you have already created a Form named Form1.

[Visual Basic] 
Public Sub InitMyForm()
   ' Adds a label to the form.
   Dim label1 As 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"
   ' Changes the windows state to Maximized.
   WindowState = FormWindowState.Maximized
   ' Displays the window information.
   label1.Text = "The Form Window is " + WindowState
End Sub 'InitMyForm

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";

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

    void InitMyForm() {
        // Adds a label to the form.
        Label* label1 = new Label();
        label1->Location = System::Drawing::Point(54, 128);
        label1->Name = S"label1";
        label1->Size = System::Drawing::Size(220, 80);
        label1->Text = S"Start position information";

        // Changes the window state to Maximized.
        WindowState = FormWindowState::Maximized;
        // Displays the state information.
        label1->Text = String::Concat(
            S"The form window is ",__box( WindowState));

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


Namespace: System.Windows.Forms

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: System.Windows.Forms (in System.Windows.Forms.dll)

See Also

System.Windows.Forms Namespace