Export (0) Print
Expand All

Label.FlatStyle Property

Gets or sets the flat style appearance of the label control.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public FlatStyle FlatStyle { get; set; }
/** @property */
public FlatStyle get_FlatStyle ()

/** @property */
public void set_FlatStyle (FlatStyle value)

public function get FlatStyle () : FlatStyle

public function set FlatStyle (value : FlatStyle)

Not applicable.

Property Value

One of the FlatStyle values. The default value is Standard.

Exception typeCondition

InvalidEnumArgumentException

The value assigned is not one of the FlatStyle values.

When the FlatStyle property is set to FlatStyle.System, any values assigned to the ImageList, Image, ImageIndex, and ImageAlign properties are ignored. In addition, the TextAlign property ignores any property values that are not vertical property settings. Horizontally aligned settings of the TextAlign property are aligned to the top of the control. 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.

NoteNote:

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. In addition, the property has no effect in the derived class, LinkLabel.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft