So, I had the same problem in one of my applications. I managed to get around this in a two-step process, which, unfortunately, requires LOT refactoring, but after doing this work, I was able to automatically configure the application on a scale at different DPIs. Here's how to do it:
All your forms must be AutoScaleMode = AutoScaleMode.Font using AutoScaleMode = AutoScaleMode.Font . When I did something, I found out that AutoScaleMode.Dpi does not work as you would expect. You should also choose what your standard DPI will be. Say it's 96, because the fact that your application was originally designed in any case, you must set all your forms to use AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F) . You can set these configurations from the constructor view. In addition, if you created any custom controls, they should all be configured to use AutoScaleMode = AsutoScaleMode.Inherit . Using these two things, you can be sure that .NET will do all the scaling for all of your static components.
Now that is getting complicated. The fact is that the structure will support all your controls with the correct size, if they are not dynamically created and are not placed inside the form.
So, if you do something like:
var myTextBox = new TextBox(); myTextBox.Location = new System.Drawing.Point(20, 20); myForm.Controls.Add(myTextBox);
then this text box will be placed at the location (20, 20) no matter what your DPI is, therefore, making it look out of place on high DPI monitors. Thus, the solution should NEVER use hard coded pixel values, instead use values ββthat scale dynamically, depending on your current DPI configuration. So instead, you can write something like:
var graphics = Graphics.FromHwnd(IntPtr.Zero);
Thus, the location you draw the control on the screen will depend on the actual DPI. And, if I can assume, I would actually extract the scaling functionality in some kind of helper class, where you define the scaling methods for the values ββby x and y, so you will have a standard scaling mechanism. Note that it is also important that you independently scale along x and y, as some screens have different pixel densities on each axis.
In any case, if you follow these two conditions, your application should look just fine, regardless of the screen displayed on it.