System.Windows.Forms.FlatStyle Enumeration

Specifies the appearance of a control.

Syntax

public enum FlatStyle

Remarks

This enumeration is used by members such as ButtonBase.FlatStyle, GroupBox.FlatStyle, and Label.FlatStyle.

In the case of the FlatStyle.Popup style button, this enumeration controls some behavior as well as appearance. The FlatStyle.Popup style control initially appears FlatStyle.Flat until the mouse pointer moves over it. When the mouse pointer moves over the FlatStyle.Popup control, it appears as a FlatStyle.Standard style control until the mouse pointer is moved off of it again.

If the FlatStyle.System style is used, the appearance of the control is determined by the user's operating system and the following property values will be ignored: Control.BackgroundImage, ImageAlign, Image, ImageIndex, ImageList, and TextAlign. In addition, the Control.BackColor property will be ignored for button controls. If supported, users can change the appearance of controls by adjusting the appearance settings of their operating system.

Note:

When the ButtonBase.FlatStyle property of the System.Windows.Forms.RadioButton and System.Windows.Forms.CheckBox classes is set to FlatStyle.System, the control is drawn by the user's operating system and the check alignment is based upon the CheckAlign and ButtonBase.TextAlign property values. The CheckAlign property value is not changed, but the appearance of the control can be affected. The check box is horizontally aligned with either the left or right edge of the control (a left or center alignment appears left aligned, right remains unchanged), and vertically aligned the same as the descriptive text. For example, if you have a System.Windows.Forms.CheckBox control with a CheckAlign property value of System.Drawing.ContentAlignment.MiddleCenter and a ButtonBase.TextAlign property value of System.Drawing.ContentAlignment.TopRight, and the ButtonBase.FlatStyle property value is set to FlatStyle.System, the check box alignment will appear to be System.Drawing.ContentAlignment.TopLeft while the text alignment remains unchanged.

Note:

Setting the FlatStyle property to FlatStyle.System is not advisable if you need to display an image on a control, display an image as a control's background, or perform precise text alignment.

Members

Member NameDescription
Flat

The control appears flat.

Popup

A control appears flat until the mouse pointer moves over it, at which point it appears three-dimensional.

Standard

The control appears three-dimensional.

System

The appearance of the control is determined by the user's operating system.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0