FormWindowState Énumération
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Spécifie le mode d’affichage d’une fenêtre de formulaire.
public enum class FormWindowState
[System.Runtime.InteropServices.ComVisible(true)]
public enum FormWindowState
[<System.Runtime.InteropServices.ComVisible(true)>]
type FormWindowState =
Public Enum FormWindowState
- Héritage
- Attributs
Champs
| Nom | Valeur | Description |
|---|---|---|
| Normal | 0 | Fenêtre dimensionnée par défaut. |
| Minimized | 1 | Fenêtre réduite. |
| Maximized | 2 | Fenêtre agrandie. |
Exemples
Dans cet exemple, vous modifiez l’état Maximized de la fenêtre du formulaire et affichez les informations d’état à l’aide d’une étiquette. Cet exemple part du principe que vous avez déjà créé un Form nom Form1.
public:
void InitMyForm()
{
// Adds a label to the form.
Label^ label1 = gcnew Label;
label1->Location = System::Drawing::Point( 54, 128 );
label1->Name = "label1";
label1->Size = 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 = String::Format( "The form window is {0}", WindowState );
}
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;
}
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"
Me.Controls.Add(label1)
' Changes the windows state to Maximized.
WindowState = FormWindowState.Maximized
' Displays the window information.
label1.Text = "The Form Window is " + WindowState
End Sub
Remarques
Cette énumération est utilisée par la Form classe. Il représente les différents états du formulaire. L’état par défaut est Normal.