-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
area-HDPI-PMv2Issues related to high DPI PerMonitorV2 modeIssues related to high DPI PerMonitorV2 mode
Description
.NET version
6.0
Did it work in .NET Framework?
No
Did it work in any of the earlier releases of .NET Core or .NET 5+?
No response
Issue description
In Form.MinimumSize setter, SetWindowPos
is called with User32.SWP.NOZORDER
flag. I suppose User32.SWP.NOZORDER | User32.SWP.NOACTIVATE
should be used, since there is no point in activating the form when MinimumSize changes
The problem I was facing was that MinimumSize and MaximumSize are not scaled when dpi changes (not sure why, in my opinion they should be), so I added scaling of them into OnDpiChanged
.
An now the magic happened: changing MinSize activates the form, which looks up the ActiveControl to set focus to. But dpi change arrives too early and the control is not visible yet, so ActiveControl remained null on nonprimary screen, but worked fine on the primary one :/
Steps to reproduce
Metadata
Metadata
Assignees
Labels
area-HDPI-PMv2Issues related to high DPI PerMonitorV2 modeIssues related to high DPI PerMonitorV2 mode