Skip to content

Support for the Win11 22H2 UnifiedPrintDialog #13264

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

Open
WolfgangHG opened this issue Apr 8, 2025 · 3 comments
Open

Support for the Win11 22H2 UnifiedPrintDialog #13264

WolfgangHG opened this issue Apr 8, 2025 · 3 comments
Assignees
Labels
api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation Regression by Win-OS
Milestone

Comments

@WolfgangHG
Copy link

.NET version

.NET8

Did it work in .NET Framework?

Not tested/verified

Did it work in any of the earlier releases of .NET Core or .NET 5+?

No response

Issue description

Windows 11 22H2 introduced a new UnifiedPrintDialog that is shown when the System.Windows.Forms.PrintDialog is used.

Image

I see two problems in this situation:

Problem 1:
I can set Landscape/portrait orientation by setting printDialog.PrinterSettings.DefaultPageSettings.Landscape = true. But this is ignored by the new dialog. After clicking "OK", the predefined orientation thus is lost, only the setting in the dialog is applied.

Problem 2:
There is no way to populate the page preview box to the right. This is actually an unnecessary feature for me, as it happens for me when using a commercial reporting tool which provides a page preview control. In this control, the "print" button just shows the printer selection dialog, and page setup (e.g. orientation) is done in other controls).

The easiest way to resolve this is probably to set the registry key "Computer\HKEY_CURRENT_USER\Software\Microsoft\Print\UnifiedPrintDialog\PreferLegacyPrintDialog" = 1 (see e.g. https://www.vbforums.com/showthread.php?901260-The-modern-print-dialog-issue-after-Windows-11-22H2-update).
This brings back the old dialog.

Would it be possible to add a property to "PrintDialog" similar to "UseEXDialog" which enables/disables the Win11 form? This would resolve the issue for me, as I cannot populate the page preview in my app.

I assume this issue is already known, but I did not find anything in this repository.

Similar issue for WPF: https://www.github.com/dotnet/wpf/issues/8355

Steps to reproduce

Attached is a small sample:
WinFormsPrintDialog.zip

You can set landscape/portrait with two radio buttons, then click the "Print Dialog" button => now the new dialog should be shown which is always set to "landscape".

If you set the registry key "Computer\HKEY_CURRENT_USER\Software\Microsoft\Print\UnifiedPrintDialog\PreferLegacyPrintDialog" = 1 and perform the same steps, you should see that the landscape setting is applied to the printer settings. So, it worked in the old version of the form.

@WolfgangHG WolfgangHG added the untriaged The team needs to look at this issue in the next triage label Apr 8, 2025
@Zheng-Li01
Copy link
Member

Get the same results from .NET 6.0 ~ 10.0 & .NET Framework on widows11 23H2 that the setting printDialog.PrinterSettings.DefaultPageSettings.Landscape = true was ignored by the new dialog as below screenshot.
Image

@KlausLoeffelmann
Copy link
Member

@merriemcgaw: I feel this needs to be addressed, because this will become ultimately a migration blocker.

I estimate it somewhere between Prio 1 and Prio 2, even.

@WolfgangHG
Copy link
Author

I prefer a property to switch between new and old OS print dialog (something similar to "UseEXDialog", which enables version 1 or version 2 of the dialog, while the Win11 dialog is version 3).

The page orientation setting issue sounds rather trivial to fix, but the dialog would also need an api to fill the page preview. And this is something that would have to be implemented by the provider of our report preview control and which also does not make sense as we start from a preview control.

@merriemcgaw merriemcgaw added the api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation label May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation Regression by Win-OS
Projects
None yet
Development

No branches or pull requests

4 participants