dotnet / dotnet/winforms

[HDPI]A form with FormBorderStyle=FixedDialog and ControlBox=false is sized incorrectly

Open
#5,113 1 comment 0 reactions 0 assignees View on GitHub
:beetle: bug area-HDPI-SA
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

* .NET Core Version:
.NET SDK 6.0.100-preview.6.21313.2

* Have you experienced this same bug with .NET Framework?:
Yes

**More info:**
There is a similar VSO bug: [631474](https://devdiv.visualstudio.com/DevDiv/_workitems/edit/631474).

**Actual behavior:**
The form is truncated at the bottom.
![Capture](https://user-images.githubusercontent.com/45864017/122187870-06eb6700-cec2-11eb-8788-3d60e70f1fde.PNG)

**Expected behavior:**
Form should look the same way as in the designer.

**Minimal repro:**
1. Create a Winforms core application in 100% DPI mode.
2. In the Form’s properties, set the FormBorderStyle = FixedDialog and ControlBox = false.
3. Adding some controls(such as Button) near the bottom of the form.
4. Declare compatibility with Window 10 in app.manifest:
![win10](https://user-images.githubusercontent.com/45864017/122189390-7877e500-cec3-11eb-82fd-975ea6450a66.png)
5. Set Windows DPI as 300%, build and run the application, then observe the form size.

Or
1. Set Windows DPI as 300%.
2. Open the attached application.
[WinFormsApp4.zip](https://github.com/dotnet/winforms/files/6661589/WinFormsApp4.zip)
3. Build and run it, then observe the form size.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.