Calling Application.EnableVisualStyles()
enables visual styles for your application. In an application the method is called usually in Main
method of your application. But in this case, you can call Application.EnableVisualStyles()
in constructor of form:
public Form1()
{
InitializeComponent();
Application.EnableVisualStyles();
}
Application.EnableVisualStyles Method
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,
EnableVisualStyles() must be called before creating any controls in
the application; typically, EnableVisualStyles() is the first line in
the Main function.