When running one of our Windows forms applications on Windows 10, the GUI looks pretty bad since the scaling seems to be messed up. Here are some 1920x1080 screenshots (note the different sizes of the second pair):
The scaling option in the Windows 10 Display settings is set to 100% (so no extra scaling should be applied). Furthermore, the following code is executed at program start:
static void Main()
{
if (Environment.OSVersion.Version.Major >= 6) //Windows Vista and higher
SetProcessDPIAware(); //disable DPI scaling (or something like that) to avoid scaling problems on Windows 10
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(Hauptmenue.Instance);
}
This code block helps a little, since it looks a lot worse on Windows 10 without. But this is not good enough...does anyone know how to "restore" the GUI to look exactly like on Windows 7 or 8?
Try to change settings on Windows 7 and Windows 8 to 100%. I don't think that it's a Windows 10 problem. Probably that's because default settings in Windows 10 are different.
You can try to "play" with AutoScaleMode Enumeration.
Try to set the mode for the form to None or to Dpi like described here:
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
Also read the answer in this SO question about scaling in different controls.
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