0

I searched the interwebs for this information, but couldn't find anything, so I thought I'd ask here.

With monitors allowing for crazy resulutions nowadays, Windows allows to scale text sizes. (Typically 125%, 150%, etc.) This unfortunately has the consequence of screwing-up many of my forms display (WinFroms), ending up with an unreadible/unusable forms.

Is there a way to read text increase value so that my application can take it into consideration when calculating label sizes, positions, and stuff?

Thanks in advance!

P.S.: Alternatively, is there a way to disable text increase for a given form? Or force it to a specific value?

Alain
  • 1
  • The search term you are looking for is `winforms dpi aware`. This related question should get you started: https://stackoverflow.com/q/4075802/87698 – Heinzi Aug 16 '22 at 14:11
  • 1
    Heinzi: Thanks for the information. It looks like using WinForms in a DPI-Aware application was not a good idea from the start. But I just figured out I can calculate the scaling factor myself by rendering a default text value in a GraphicsPath and measure its size using GetBounds, then compare it to what it should be if scaling would be 100%. So at least I'll be able to use that... – Alain Aug 16 '22 at 14:38

0 Answers0