winforms icon indicating copy to clipboard operation
winforms copied to clipboard

Recreate handle resizes the form on monitor with non-96 DPI

Open RussKie opened this issue 4 years ago • 6 comments

  • .NET Core Version: all
  • Have you experienced this same bug with .NET Framework?: haven't checked

Problem description:

On a monitor with non-default DPI (e.g. 150%, 200%, etc.) a form changes its dimensions upon recreation of its handle:

https://user-images.githubusercontent.com/4403806/140443304-0be2fda6-f37e-40b1-b1f8-d4467ba18339.mp4

On a monitor with 100% scale factor everything works as expected.

Expected behavior: The form retains the geometry.

Minimal repro:

  1. Unzip repro.zip in to .\src\System.Windows.Forms\tests\IntegrationTests\WinformsControlsTest
  2. Update Program.cs to invoke Form1
  3. F5

RussKie avatar Nov 05 '21 01:11 RussKie

@RussKie, I tried this on my machine with standalone app but could not repro. Only difference is, I have latest bits here.

dreddy-work avatar Nov 16 '21 21:11 dreddy-work

I'll test it against the main and see if it's been fixed.

RussKie avatar Nov 16 '21 23:11 RussKie

Tested against the latest main. It is still happening for me on a secondary monitor with 150% SF (the primary monitor is at 100%)

https://user-images.githubusercontent.com/4403806/142094113-ff1f3f9f-ff04-444a-b03a-52681a32da66.mp4

RussKie avatar Nov 17 '21 01:11 RussKie

@RussKie , I was going over this issue as part of the push we are making. I tried this particular scenario on a 150/200 DPIs but i see no issue. I do see Form being hidden completely when showTaskbar is set to false though. Can you try one last time and update me ?

dreddy-work avatar Nov 15 '22 21:11 dreddy-work

@dreddy-work, verified this on .NET 8.0 latest build: 8.0.100-alpha.1.22565.7, issue only repro on a high 150/200 DPIs secondary monitor, it doesn't repro on a high DPIs Primary monitor.

Amy-Li03 avatar Nov 21 '22 08:11 Amy-Li03

This submission has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 14 days.

It will be closed if no further activity occurs within 7 days of this comment.

ghost avatar Dec 05 '22 10:12 ghost