System.Windows.Forms.Application.EnableVisualStyles Method

Enables visual styles for the application.

Syntax

public static void EnableVisualStyles ()

Remarks

This method enables visual styles for the application. Visual styles are the colors, fonts, and other visual elements that form an operating system theme. Controls will draw with visual styles if the control and the operating system support it. To have an effect, Application.EnableVisualStyles must be called before creating any controls in the application; typically, Application.EnableVisualStyles is the first line in the Main function. A separate manifest is not required to enable visual styles when calling Application.EnableVisualStyles.

Note:

Prior to the .NET Framework 2.0, the FlatStyle property of some controls, such as controls that derive from System.Windows.Forms.ButtonBase, had to be set to FlatStyle.System in order for the controls to be drawn with visual styles. In applications written with the .NET Framework 2.0, this is no longer necessary.

Note:

This method will have no effect for controls hosted in Internet Explorer.

Requirements

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