Windows form Button appearance is getting changed while running application

328 Views Asked by At

I am working on a Windows form Application, came up with some weird behavior. The appearance of all the buttons in the form are getting changed when running the application using Visual Studio.

For example : Button style and Appearance at Design time,

enter image description here

While at runtime Buttons look like as below,

enter image description here

Any help will be highly appreciated.

1

There are 1 best solutions below

0
Thierry Brémard On

You are missing the call to:

        Application.EnableVisualStyles();

When added, in Main before displaying the Form you will get your expected behavior. If you are exporting this form in a dll you can still add this call inside the constructor of the form.