1
votes

I have an application which uses three UI frameworks:

  • OWL
  • Windows Forms
  • WPF

The WinForms and WPF forms and dialogs use fonts that are noticeably smaller than the OWL fonts.

If I use DPI scaling (to 125%) in Windows 10, it does a very good job of upscaling a Windows Forms dialog. If I use Scale on a Windows Form it only scales the controls and not the fonts. If I use the functions suggested here:

https://github.com/Microsoft/WPF-Samples/blob/master/PerMonitorDPI/WinFormsHost/MainWindow.xaml.cs

I get scaled controls but not fonts if I only use the form scaling. If I use the extra font scaling functions, that increases the size of the dialog way beyond the original desired scaling (from 1.25 to 1.6 roughly).

Does anyone know how to scale a WinForms form properly like Windows 10 seems to be able to (without changing screen DPI setting to 125%)?

1
I asked this question years ago, and the solution was to use WPF.Jonathon Reinhart
It is not very obvious how you know that OWL is using the wrong fonts, it doesn't have a wysiwyg designer. Most typical issue is that the Winforms and WPF designers run inside VS, which is a dpiAware program. But you probably did not declare your own app to be dpiAware, so it runs with DPI virtualization enabled, at 96 dpi (aka 100%). Which makes the window and fonts smaller thanks to automatic scaling built into these UI libraries. Not an OWL feature. If that scaling doesn't work properly on the controls then you have to show us repro code.Hans Passant

1 Answers

0
votes

The answer is to place everything in a flow layout or a table layout. Then spend time figuring out how to make sure they layout correctly.

A better answer would be WPF but that's not always an answer.