Export (0) Print
Expand All
Expand Minimize

FormBorderStyle Enumeration

Specifies the border styles for a form.

[Visual Basic]
<Serializable>
<ComVisible(True)>
Public Enum FormBorderStyle
[C#]
[Serializable]
[ComVisible(true)]
public enum FormBorderStyle
[C++]
[Serializable]
[ComVisible(true)]
__value public enum FormBorderStyle
[JScript]
public
   Serializable
 ComVisible(true)
enum FormBorderStyle

Remarks

This enumeration is used by the Form class. It represents the different styles of the form. The default style is Sizable.

Members

Member name Description
Fixed3D

Supported by the .NET Compact Framework.

A fixed, three-dimensional border.
FixedDialog

Supported by the .NET Compact Framework.

A thick, fixed dialog-style border.
FixedSingle

Supported by the .NET Compact Framework.

A fixed, single-line border.
FixedToolWindow

Supported by the .NET Compact Framework.

A tool window border that is not resizable. A tool window does not appear in the taskbar or in the window that appears when the user presses ALT+TAB.
None

Supported by the .NET Compact Framework.

No border.
Sizable

Supported by the .NET Compact Framework.

A resizable border.
SizableToolWindow

Supported by the .NET Compact Framework.

A resizable tool window border. A tool window does not appear in the taskbar or in the window that appears when the user presses ALT+TAB.

Example

[Visual Basic, C#, C++] In this example, you change the form border style to Fixed3d and display the border's 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(80, 80)
   label1.Name = "label1"
   label1.Size = New System.Drawing.Size(132, 80)
   label1.Text = "Start Position Information"
   Me.Controls.Add(label1)
   
   ' Changes the border to Fixed3D.
   FormBorderStyle = FormBorderStyle.Fixed3D
   
   ' Displays the border information.
   label1.Text = "The border is " + FormBorderStyle
End Sub 'InitMyForm

[C#] 
public void InitMyForm()
{
    // Adds a label to the form.
    Label label1 = new Label();
    label1.Location = new System.Drawing.Point(80,80);
    label1.Name = "label1";
    label1.Size = new System.Drawing.Size(132,80);
    label1.Text = "Start Position Information";
    this.Controls.Add(label1);

    // Changes the border to Fixed3D.
    FormBorderStyle = FormBorderStyle.Fixed3D;

    // Displays the border information.
    label1.Text = "The border is " + FormBorderStyle;    
}

[C++] 
public:
    void InitMyForm()
    {
        // Adds a label to the form.
        Label* label1 = new Label();
        label1->Location = System::Drawing::Point(80,80);
        label1->Name = S"label1";
        label1->Size = System::Drawing::Size(132,80);
        label1->Text = S"Start Position Information";
        this->Controls->Add(label1);

        // Changes the border to Fixed3D.
        FormBorderStyle = FormBorderStyle::Fixed3D;

        // Displays the border information.
        label1->Text = String::Format( S"The border is {0}", __box(FormBorderStyle));    
    }

[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.

Requirements

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

Show:
© 2014 Microsoft