Avatar of FrancineTaylor
FrancineTaylor
 asked on

How to grab the printer icon click event from PrintDocument

I am using PrintDocument for printing my reports.  My boss has required that the report do this sequence of actions:

1. Preview report
2. When printer button is clicked, go to a PrintDialog to edit printer settings
3. Print report

Now, I've found that I can assign a BeginPrint event to the document, but that triggers both when the preview is printed and when the printer icon is clicked.  I need something that is going to catch the print icon click event from the preview of a PrintDocument.
C#

Avatar of undefined
Last Comment
Bob Learned

8/22/2022 - Mon
Bob Learned

Are you using a PrintDocument, PrintPreviewControl, and a PrintDialog in combination, as described in this article?

The Print Dialog Box
http://www.functionx.com/vcsharp2008/controls/dlgprint.htm
FrancineTaylor

ASKER
This doesn't tell me anything about the PrintPreviewDialog, which is what is used to preview a report for a PrintDocument.  The ShowDialog() method on the PrintPreviewControl displays the report in the form, and presents the user with a "print" button.

If that button is clicked, the report prints.

I need to be able to intercept that button click so I can present the user with a PrintDialog before printing occurs.
ASKER CERTIFIED SOLUTION
Bob Learned

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23