BoundsSpecified 列舉

定義

指定當定義控制項的大小和位置時,所要使用之控制項的邊界。

此列舉支援其成員值的位元組合。

C#
[System.Flags]
public enum BoundsSpecified
繼承
BoundsSpecified
屬性

欄位

名稱 Description
All 15

指定 LocationSize 屬性值均為已定義。

Height 8

指定控制項的高度為已定義。

Location 3

指定控制項的 XY 座標均為已定義。

None 0

未指定邊界。

Size 12

指定控制項的 WidthHeight屬性值均為已定義。

Width 4

指定控制項的寬度為已定義。

X 1

指定控制項的左邊緣為已定義。

Y 2

指定控制項的頂端邊緣為已定義。

範例

C#
private void MyForm_Layout(object sender, System.Windows.Forms.LayoutEventArgs e)
{
   // Center the Form on the user's screen everytime it requires a Layout.
   this.SetBounds((Screen.GetBounds(this).Width/2) - (this.Width/2),
       (Screen.GetBounds(this).Height/2) - (this.Height/2),
       this.Width, this.Height, BoundsSpecified.Location);	
}

備註

呼叫 SetBoundsCore 類別的 ControlSetBounds 方法時,請使用這個列舉的成員。

適用於

產品 版本
.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

另請參閱