nooogle / CDS.CSharpScripting

Drop-in user control for C# editing with intellisense and compilation. Script compilation and execution classes for GUI and console applications.
MIT License
9 stars 3 forks source link

Figure right way to control high DPI settings on WinForms code editor #22

Closed nooogle closed 3 years ago

nooogle commented 3 years ago

The code editor has a different font size wrt WinForms controls. Will be due to editor being a WPF control and having a different behaviour for high DPI compared to WinForms.

nooogle commented 3 years ago

V1.0.11 sorts this. The code editor sets the font size to 96/72 * host font size. See WPF text block for more info.

The WinForms test app uses [assembly: DisableDpiAwareness] to stop the app adjusting itself for a high DPI environment. For the first time this means that the design time and runtime UX experience is the same! (As long as Visual Studio is configured to run at 100% scaling.)