FormBorderStyle 列舉

定義

指定表單的框線樣式。

public enum class FormBorderStyle
[System.Runtime.InteropServices.ComVisible(true)]
public enum FormBorderStyle
public enum FormBorderStyle
[<System.Runtime.InteropServices.ComVisible(true)>]
type FormBorderStyle = 
type FormBorderStyle = 
Public Enum FormBorderStyle
繼承
FormBorderStyle
屬性

欄位

Fixed3D 2

固定且具 3D 效果的框線。

FixedDialog 3

粗且固定的對話方塊樣式框線。

FixedSingle 1

固定且單一的線條框線。

FixedToolWindow 5

無法調整的工具視窗框線。 當使用者按下 ALT+TAB 時,在工作列或出現的視窗中不會顯示工具視窗。 雖然在工作列上通常不顯示指定 FixedToolWindow 的表單,但是因為 ShowInTaskbar 屬性的預設值為 false,您必須確定已將屬性設為 true

None 0

無框線。

Sizable 4

可調整的框線。

SizableToolWindow 6

可調整的工具視窗框線。 當使用者按下 ALT+TAB 時,在工作列或出現的視窗中不會顯示工具視窗。

範例

在此範例中,您會將表單框線樣式變更為 Fixed3d ,並使用標籤顯示框線的資訊。 此範例假設您已經建立 Form 名為 的 Form1

public:
   void InitMyForm()
   {
      // Adds a label to the form.
      Label^ label1 = gcnew Label;
      label1->Location = System::Drawing::Point( 80, 80 );
      label1->Name = "label1";
      label1->Size = 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 = String::Format( "The border is {0}", FormBorderStyle );
   }
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;	
}
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

備註

這項列舉供 Form 類別使用。 它代表表單的不同樣式。 預設樣式為 Sizable

適用於

另請參閱