I'm working on a C# / .net app. I want the user to be able to print preview, but I don't want the user to be able to print from the print straight from the preview dialog.
The print preview dialog has a little printer button on it that sends the previewed pages straight to the printer. Question is, is there a way to get rid of / disable / intercept this button click?
You can access the print button, and any other button from a print preview control by searching in the container's controls collection.
For the print button:
(ToolStripButton)((ToolStrip)printPreviewDialog1.Controls[1]).Items[0]
so, to disable it,
((ToolStripButton)((ToolStrip)printPreviewDialog1.Controls[1]).Items[0]).Enabled = false;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With