views:

119

answers:

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?

A: 

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
Seems like the best solution is to make my own dialog then. Thanks.
mizipzor