.NET version
.NET8.0, .NET6.0
Did it work in .NET Framework?
Not tested/verified
Did it work in any of the earlier releases of .NET Core or .NET 5+?
No
Issue description
TestUpDown.zip
I have done a simple test project with NumericUpDown and Button controls.
- Controls are placed direct to the Form.
- Controls are placed on a TableLayoutPanel (Parent is the Form)
- Controls are placed on a Panel (Parent is the Form)
- Controls are placed on a Panel (Parent is an other Panel which is placed on the Form)
When pressing the Buttons one gets a MessageBox with information about DisplayRectangle and Margin values for the Button and NumericUpDown.
When you run with 100% screen DPI the Margin values are all set to 3. But when you run with a higher DPI the Margin values are weird. For example in test case 4 with DPI=150% I get NumericUpDown Margin values 9, 13, 9, 13 and for the Button I get 4, 5, 4, 5.
In the project I have set ApplicationHighDpiMode to PerMonitorV2. But it seems that the issue is also present in other DpiModes.
Steps to reproduce
Run the project with different DPI values and press the Buttons and notice the MessageBox values.
Form at 100% DPI

MessageBox with DPI=150% when pressing button4

.NET version
.NET8.0, .NET6.0
Did it work in .NET Framework?
Not tested/verified
Did it work in any of the earlier releases of .NET Core or .NET 5+?
No
Issue description
TestUpDown.zip
I have done a simple test project with NumericUpDown and Button controls.
When pressing the Buttons one gets a MessageBox with information about DisplayRectangle and Margin values for the Button and NumericUpDown.
When you run with 100% screen DPI the Margin values are all set to 3. But when you run with a higher DPI the Margin values are weird. For example in test case 4 with DPI=150% I get NumericUpDown Margin values 9, 13, 9, 13 and for the Button I get 4, 5, 4, 5.
In the project I have set ApplicationHighDpiMode to PerMonitorV2. But it seems that the issue is also present in other DpiModes.
Steps to reproduce
Run the project with different DPI values and press the Buttons and notice the MessageBox values.

Form at 100% DPI
MessageBox with DPI=150% when pressing button4
