Label.FlatStyle 屬性

定義

取得或設定標籤控制項的平面樣式外觀。

public:
 property System::Windows::Forms::FlatStyle FlatStyle { System::Windows::Forms::FlatStyle get(); void set(System::Windows::Forms::FlatStyle value); };
public System.Windows.Forms.FlatStyle FlatStyle { get; set; }
member this.FlatStyle : System.Windows.Forms.FlatStyle with get, set
Public Property FlatStyle As FlatStyle

屬性值

FlatStyle

其中一個 FlatStyle 值。 預設值是 Standard

例外狀況

所指派的值不是其中一個 FlatStyle 值。

備註

FlatStyle當 屬性設定 FlatStyle.System 為 時,會忽略指派給 ImageListImageImageIndexImageAlign 屬性的任何值。 此外,屬性 TextAlign 會忽略任何不是垂直屬性設定的屬性值。 屬性的水準對齊設定 TextAlign 會對齊控制項頂端。 例如,如果您將 TextAlign 屬性設定為 ContentAlignment.TopCenterContentAlignment.MiddleCenterContentAlignment.BottomCenter ,當 FlatStyle 屬性設定 FlatStyle.System 為 時,控制項中的 Label 文字會對齊控制項界限內的頂端和中央位置。

注意

在 .NET Framework 1.1 版中,將 屬性 FlatStyle.System 設定 FlatStyle 為 並不會忽略 屬性的值 TextAlign 。 此外,屬性在衍生類別中沒有任何作用。 LinkLabel

適用於