I'm running into problems with getting a WinForms app to display correctly at high DPI settings. I've checked various web sites, and the WinForms all have the correct AutoScaleMode. I've tried setting this to both DPI and Font. However, the forms always get cut off near the bottom when using high DPI settings (e.g. 125%).
I added some code to check, and if I set AutoScaleMode to DPI, when the form loads, I see that AutoScaleDimensions is 120,120 when the form loads, and CurrentAutoScaleDimensions is also 120,120. In the Form.designer.cs file, there is a line to set AutoScaleDimension to 96,96.
If I set AutoScaleMode to Font, then I can see in designer that AutoScaleDimension is correctly set to new System.Drawing.SizeF(6F, 13F), but when the form loads, both AutoScaleDimension and CurrentAutoScaleDimension are set to 8F,16F.
This app mixes some WPF with WinForms, and the WPF screens appear first. So based on DPI Scaling in .Net 3.5 in Mixed WinForms and WPF Application I tried setting the TextFormattingMode for the application, and for the WPF screens that show first, to "Display", but it makes no difference.
I am, frankly, at a loss as to what's causing this. I suppose I could add code to resize things programmatically by detecting the DPI at runtime, but I shouldn't have to do that. The AutoScaleMode (and related) properties are supposed to make this fairly automatic. So what else should I be checking for that might cause this problem?