I have a .net WinForms app with buttons that are displaying as XP style (rounded corners) at design time, but Windows 2000 style (square corners) at runtime. My desktop theme is set to XP style. I'm guessing there's an obvious setting that I'm overlooking. Thanks.
In your Program.Main() method make sure you have these 2 lines before Application.Run:
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
static void Main()
{
Application.EnableVisualStyles();
Application.Run(new Form1());
}
EnableVisualStyles must be called before creating any controls in the application; typically, EnableVisualStyles is the first line in the Main function.
MSDN Reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With