Label.FlatStyle Label.FlatStyle Label.FlatStyle Label.FlatStyle Property

定義

取得或設定標籤控制項的平面樣式外觀。Gets or sets the flat style appearance of the label control.

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 值。One of the FlatStyle values. 預設值為 StandardThe default value is Standard.

例外狀況

所指派的值不是其中一個 FlatStyle 值。The value assigned is not one of the FlatStyle values.

備註

Image ImageList ImageIndex ImageAlign當屬性設定為FlatStyle.System時,會忽略指派給、、和屬性的任何值。 FlatStyleWhen the FlatStyle property is set to FlatStyle.System, any values assigned to the ImageList, Image, ImageIndex, and ImageAlign properties are ignored. 此外, TextAlign屬性會忽略非垂直屬性設定的任何屬性值。In addition, the TextAlign property ignores any property values that are not vertical property settings. TextAlign屬性的水準對齊設定會對齊控制項的頂端。Horizontally aligned settings of the TextAlign property are aligned to the top of the control. 例如,如果TextAlign您將屬性設定為ContentAlignment.TopCenterContentAlignment.MiddleCenterContentAlignment.BottomCenterFlatStyle 當屬性FlatStyle.System設定為時,控制項中的文字將會對齊頂端和中心位置。Label在控制項的界限內。For example, if you set the TextAlign property to ContentAlignment.TopCenter, ContentAlignment.MiddleCenter, or ContentAlignment.BottomCenter, when the FlatStyle property is set to FlatStyle.System, the text in the Label control will be aligned to the top and center locations within the bounds of the control.

注意

在 .NET Framework 版本1.1 中,將FlatStyle屬性設定為FlatStyle.System並不會忽略TextAlign屬性的值。In the .NET Framework version 1.1, setting the FlatStyle property to FlatStyle.System does not cause the value of the TextAlign property to be ignored. 此外,此屬性在衍生類別LinkLabel中不會有任何作用。In addition, the property has no effect in the derived class, LinkLabel.

適用於