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.System ImageList Image当属性设置为时, 将忽略ImageAlign ImageIndex分配给、、和属性的任何值。 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.BottomCenter, 则FlatStyle 当属性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.

适用于