Link to home
Start Free TrialLog in
Avatar of restabro
restabroFlag for United States of America

asked on

How to get info from a PrintDialog box

I'm trying to get a couple of things from a PrintDialog box:  I need to know if the "All", "Pages", or "Selection" radio button has been pushed and, if the "Pages" radiobutton is pushed, what pages have been entered.

I use the following code to determine whether the OK button is pushed, but I can't find much help on the AllowPrintPages and AllowSelection properties.

                PrintDocument* pdoc = new PrintDocument();
      PrintDialog* pd = new PrintDialog();

      pd->Document = pdoc;

      if (pd->ShowDialog() == DialogResult::OK)
                {
                        etc.....
                }
Avatar of AlexFM
AlexFM

PrintDialog.PrinterSettings property returns PrinterSettings which contains this information.
Avatar of restabro

ASKER

That gets me a little closer, but please provide coding examples for the following conditions:

1.  Determining if the "All" button has been selected

2.  Determining if the "Pages" button has been selected

3.  If the "Pages" button has been selected, how to determine what the "From" page is

4.  Determining if the "Selection" button was pushed



Note that I increased the point total to 500. Thank you.

ASKER CERTIFIED SOLUTION
Avatar of DanRollins
DanRollins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial