FormWindowState 列挙体
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

<ComVisibleAttribute(True)> _ Public Enumeration FormWindowState



この例では、フォームのウィンドウの状態を Maximized に変更し、ラベルを使用して状態情報を表示します。この例は、Form1 という名前の Form が既に作成されていることを前提にしています。
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 '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"; 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: 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.set_Location(new System.Drawing.Point(54, 128)); label1.set_Name("label1"); label1.set_Size(new System.Drawing.Size(220, 80)); label1.set_Text("Start position information"); this.get_Controls().Add(label1); // Changes the window state to Maximized. set_WindowState(FormWindowState.Maximized); // Displays the state information. label1.set_Text("The form window is " + get_WindowState()); } //InitMyForm

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- FormWindowState 列挙体のページへのリンク