1

Im using a System.Windows.Controls.PrintDialog to let the user print one or more pages from my application. This is what I currently got:

        PrintDialog printDialog = new PrintDialog();

        printDialog.PageRangeSelection = PageRangeSelection.AllPages;
        printDialog.UserPageRangeEnabled = true;

        if (printDialog.ShowDialog() == true)
        {
            // do print ...
        }

Im looking for the option to enable the Current Page radio button in the dialog. How to enable it?

Mizipzor
  • 51,151
  • 22
  • 97
  • 138
  • May be it's some limitation of WPF? WindowsForms PrindDialog have property AllowCurrentPage. – Pavel Belousov Jun 09 '10 at 08:00
  • Yes, Im looking for the direct counterpart of the System.Windows.Forms.PrintDialog.AllowCurrentPage property. I dont think its a limitation of WPF, why would they keep the radiobutton? Seems like other parts of the dialog has changed. – Mizipzor Jun 09 '10 at 08:03
  • I think WPF PrintDialog only uses standard printing dialog of Windows and does not give you API for change properties of this radiobutton. – Pavel Belousov Jun 09 '10 at 08:39

1 Answers1

0

If you will decompile reference PresentationFramework.dll by Reflector you would be able to see that this class have nothing about CurrentPage. I think this radiobutton is disabled by default in Win32PrintDialog. In WinForms this radiobutton definitely is disabled by default:

    [DefaultValue(false), SRDescription(SR.PDallowCurrentPageDescr)] 
    public bool AllowCurrentPage {
        get { return allowCurrentPage;}
        set { allowCurrentPage = value;}
    } 

I suppose that you can't enable this radiobutton, but I can be mistaken.

Pavel Belousov
  • 1,848
  • 2
  • 14
  • 22