通过


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 值。 默认值为 Standard

例外

分配的值不是其中一个 FlatStyle 值。

注解

当属性设置为时,将忽略分配给 > 和属性的任何值。 此外,该 TextAlign 属性将忽略任何不是垂直属性设置的属性值。 属性的水平 TextAlign 对齐设置与控件顶部对齐。 例如,如果将属性设置为TextAlignContentAlignment.MiddleCenter或者ContentAlignment.BottomCenter当属性设置为FlatStyle.System该属性时FlatStyle,控件Label中的文本将与控件边界内的顶部ContentAlignment.TopCenter和居中位置对齐。

注释

在 .NET Framework 版本 1.1 中,将 FlatStyle 属性设置为 FlatStyle.System 不会导致忽略该属性的值 TextAlign 。 此外,属性在派生类 LinkLabel中不起作用。

适用于