Posted 1 December 2017, 2:00 am EST
Hi Mohit,
Thanks for the quick response and the attached sample. Unfortunately, we are using ActiveReports v11 not v12 as the sample uses.
I looked at the sample added the code to our code. Unfortunately I ran into a couple issues. First, in PreFilterMessage the code
if ((keyData & Keys.Control) == Keys.Control && (keyData & Keys.KeyCode) == Keys.P)
is never true (even when I do a Ctrl+P) thus that key stroke is unable to be filtered out.
Additonally, the issue we are having is that we have a toolstrip. Included in that toolstrip is the Print ToolStripItem (index number 2 - Print). When that toolstrip item is clicked our code handles it and displays our own print dialog. Unfortunately, after that your PrintDialog is called (the print dialog itself can be hidden viewer.ReportViewer.PrintingSettings = PrintingSettings.None)
So as you can see, your print dialog is being called without any Ctrl-P keystroke. It doesn’t do me any good to filter out the Ctrl-P because it is never there to begin with.
Is it possible to disable your print dialog completely?
Thank you,
Mike