Orientation and Paper on Print Setup dialog

frankborty 21 Reputation points
2022-06-20T14:18:54.513+00:00

Working to a WPF Application (.NET fw 4.5), I can't find a way to display a print setup dialog as in the following image (I think it's based on Windows Forms but a WPF solution it would be better):

213043-image.png

Using the code:

PrintDialog myPrintDialog = new PrintDialog();  
myPrintDialog.ShowDialog();  

I obtain a dialog with Print Range and Copies Settings (which I don't need) but not Paper and Orientation (which I want to get).

I read the question wpfcsharp-print-dialog-settings but I can't figure out how to use the accepted answer.

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,820 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,667 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,198 questions
{count} votes

Accepted answer
  1. Castorix31 81,461 Reputation points
    2022-06-20T14:55:21.22+00:00

    You can get it, but it is the old Dialog Box, replaced by PageSetupDialog as MSDN says at : print-dialog-box
    For the PageSetupDialog, you can do for example :

                System.Windows.Forms.PageSetupDialog PageSetupDialog1 = new System.Windows.Forms.PageSetupDialog();  
                PageSetupDialog1.PageSettings = new System.Drawing.Printing.PageSettings();  
                PageSetupDialog1.PrinterSettings = new System.Drawing.Printing.PrinterSettings();  
                PageSetupDialog1.AllowOrientation = true;  
                PageSetupDialog1.AllowPaper = true;  
                PageSetupDialog1.AllowPrinter = true;  
                DialogResult result = PageSetupDialog1.ShowDialog();  
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful