閱讀英文

共用方式為


FormBorderStyle 列舉

定義

指定表單的框線樣式。

C#
[System.Runtime.InteropServices.ComVisible(true)]
public enum FormBorderStyle
C#
public enum FormBorderStyle
繼承
FormBorderStyle
屬性

欄位

名稱 Description
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

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

備註

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

適用於

產品 版本
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

另請參閱