You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Size of Form and controls is bigger in WinForms .NET Core app compared to WinForms .NET Framework app #1948
Have you experienced this same bug with .NET Framework?: No
Problem description:
Using Visual Studio 2019 16.3 Preview 4 create a WinForms .NET Core app and a WinForms
.NET Framework app, which have same designer code with some controls added. WinFormsFrameworkApp.zip WinFormsCoreApp.zip
Build and run these 2 apps, and compare size of forms and controls
Actual behavior:
Size of Form and controls is bigger in WinForms .NET Core app compared to WinForms .NET Framework app (for example Form is 1178x799 pixels on .NET Core 3.0 and 1010x697 pixels on .NET Framework 4.8)
Expected behavior:
They should have same size (pixel by pixel identical).
changed the title [-]Size of Form and controls are bigger in WinForms .NET Core app compared to WinForms .NET Framework app[/-][+]Size of Form and controls is bigger in WinForms .NET Core app compared to WinForms .NET Framework app[/+]on Sep 20, 2019
Form size in designer is set to 1028x706 (font is Calibri 12pt)
Button size in designer is set to 70x28 (font is Calibri 12pt)
.NET Framework 4.8 app respects that sizes, while .NET Core 3 app is bigger than that values..
Activity
[-]Size of Form and controls are bigger in WinForms .NET Core app compared to WinForms .NET Framework app[/-][+]Size of Form and controls is bigger in WinForms .NET Core app compared to WinForms .NET Framework app[/+]bairog commentedon Sep 20, 2019
In all my form controls I don't use
Segoe UI 9pt, I useCalibri 12pt.Why my forms are not pixel by pixel identical in that case?
bairog commentedon Sep 23, 2019
Let me clarify - for example in both projects:
.NET Framework 4.8 app respects that sizes, while .NET Core 3 app is bigger than that values..
RussKie commentedon Sep 24, 2019
I believe the result is due to this line:
If you comment it out, it renders the form in the same size.
Here's the relevant info: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.containercontrol.autoscaledimensions?redirectedfrom=MSDN&view=netframework-4.8#remarks
@OliaG this may trip a few people, perhaps we need to highlight this somehow.
/cc: @merriemcgaw