Troubles with a DPI Aware application
-
I have a WinForm application that occasionally creates a range of Controls at runtime (buttons, labels and so on) always setting precise sizes and fonts for them. Everything runs finely in normal DPI (96) but if I switch to high DPI (125%) all the controls are wrongly resized showing clipped text. I tried using the DPI Aware function, both in manifest and DLL, but with no success (apparently nothing changes). All want to do is prevent Windows from resizing the controls, I just want to disable this whole DPI resizing thing. Is that possible?
-
I have a WinForm application that occasionally creates a range of Controls at runtime (buttons, labels and so on) always setting precise sizes and fonts for them. Everything runs finely in normal DPI (96) but if I switch to high DPI (125%) all the controls are wrongly resized showing clipped text. I tried using the DPI Aware function, both in manifest and DLL, but with no success (apparently nothing changes). All want to do is prevent Windows from resizing the controls, I just want to disable this whole DPI resizing thing. Is that possible?
Try to set AutoScaleMode of the form to NONE. Not sure if it helps, but there is a good article related to scaling http://en.csharp-online.net/Layout[^]