1

I have a window that is not scaling.

I have applied the PerMonitorV2 flag, and also I have in the class

    this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

When I try to see the window in DPI 100%, everything is fine

When I try to see the window in DPI 150%, I see the overall window size is bigger, but the size of user control didn't enlarge according to the window.

If I delete AutoScaleDimenstion and AutoScaleMode everything works fine in both cases which is so much weird.

Please assist, thanks.

Zakk
  • 758
  • 3
  • 11
  • 20
  • Per-monitor DPI awareness in Winforms is fairly tricky, Win10 and .NET 4.7 required. Microsoft is very worried about accidentally breaking apps that already handle it by themselves, so you have to be explicit about wanting it. Config details are in [this MSDN article](https://learn.microsoft.com/en-us/dotnet/framework/winforms/high-dpi-support-in-windows-forms) – Hans Passant Jul 08 '18 at 16:25
  • I already have windows 10 and .NET 4.7.1 Also this parameter fixed alot of things to me, but created problems in few user controls only.. @HansPassant – Zakk Jul 08 '18 at 16:26
  • Follow *all* the guidance in the article. You must show us repro code if "it doesn't work". Nobody can know what "created problems" could possibly mean. – Hans Passant Jul 08 '18 at 16:28

0 Answers0