-
Notifications
You must be signed in to change notification settings - Fork 982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing scaling issue with initializing Form on non-primary monitor with different DPI settings. #5557
Conversation
…th different DPI settings. In this case, Form Handle is created according to the Secondary monitor DPI hence, doesn't receive `DPI_CHANGED` message. Fix is making sure we scale the Form according to DPI when Handle is created. Fixes #4854 and related issues.
…eddy/SecondaryMonitorInitiation
@Balkoth , this change is helping scale the Form initialization on the secondary monitor. I see couple of issues in this regard raised by you. Will you be able to verify some of your scenarios with this branch? Note: This is handling only the Form and you might still have issues with child controls in it. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, why is it marked as "work in progress"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 modulo the comments
…eddy/SecondaryMonitorInitiation
2a6a86a
…eddy/SecondaryMonitorInitiation
…eddy/SecondaryMonitorInitiation
I really would want to help, but once again i can not figure out how to build the project in Visual Studio 2019. I have tried with the virtual machine WinDev2106Eval patched to latest, installed everything mentioned in the Developer Guide and it still does not work. I start Visual Studio through an administrator developer prompt with the provided start-vs.cmd batch file. I am really tired of messing around trying to build this. If you seriously want anyone outside of microsoft to contribute to this, please provide correct instructions or provide an actual uptodate developer vm where everything is setup to build bleeding edge version of winforms. |
.NET 6.0 projects can only be built in VS 2022. |
Sorry, but this is the wrong location to put such information. Put it in ADVANCE into the developer guide where everyone can see it. |
@Balkoth, I agree that there is a need to update our documentation to current state. There are couple of other sections, that went out of date. We will be looking into it in the coming days. If you do not have VS 2022, building from command line should always work. Did you try that? Once you have updated binaries, rest of the process to test them should work as defined in the docs. Let me know how it goes. |
Take it in RC2? |
Not for RC2. Change touches the flow of Handle creation that impact all modes. |
@Balkoth , I am merging this but i would still love your validations here. Let me know how i can help on this. Command line build is expected to work but if you still have issues, let me know. |
I will try my best to do a build tomorrow. |
So i successfully can do a command line build with an VS2019 administrator developer shell using "build.cmd". Now how can i get an existing c# winforms project to run with the built binaries? |
There are few ways
|
I normally use the second option. It is easier when running in debug or from VS. |
I have a script that helps automating the 2nd step: https://gist.github.com/RussKie/bb11e213f04729603e533856865922c1 |
Looks like you're using Preview7 for your tests, but building Windows Forms from the main (which is .NET 7.0, but very close to .NET 6.0 RC2/GA). This won't work as there are several months worth of changes between Preview7 and the main. |
I installed what was recommend by the app launcher when i was directed to a microsoft site. Do you have a link as a quick google-search does not yield any results: https://www.google.com/search?q=.net+6+Release+Candidate+2 |
Apologies, I should've added the link. You can find nightlies at https://github.com/dotnet/installer, scroll down the page and you'll see a bunch of links. |
Ok, i got it to run, but the fix does not work. The form is not centered on my secondary screen: My sample for testing is avaialble here: |
…th different DPI settings. (dotnet#5557) * Fixing scaling issue with initializing Form on non-primary monitor with different DPI settings. In this case, Form Handle is created according to the Secondary monitor DPI hence, doesn't receive `DPI_CHANGED` message. Fix is making sure we scale the Form according to DPI when Handle is created. Fixes dotnet#4854 and related issues.
…th different DPI settings. (dotnet#5557) * Fixing scaling issue with initializing Form on non-primary monitor with different DPI settings. In this case, Form Handle is created according to the Secondary monitor DPI hence, doesn't receive `DPI_CHANGED` message. Fix is making sure we scale the Form according to DPI when Handle is created. Fixes dotnet#4854 and related issues.
In this case, Form Handle is created according to the Secondary monitor DPI hence, doesn't receive
DPI_CHANGED
message.Fix is making sure we scale the Form according to DPI when Handle is created.
Fixes #4854 and related issues.
Microsoft Reviewers: Open in CodeFlow