Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
See more:
1. I want to access the button Print on printdialog and to hide it, so it will only be buttons Cancel and Apply.
2. After user click`s the button Apply, to hide/close printdialog.

additional information moved from comment below
I am using the dialog that contains buttons Print, Cancel and Apply. Regardless to your operating system.

I tried something like:

C#
Button btP = (Button)printDialog1.Container.Components["Print"];


but there`s error: printDialog1.Container is null

I can`t find the names of the buttons,... on printdialog.
Posted
Updated 4-Nov-12 0:02am
v2
Comments
marcel zol 4-Nov-12 5:12am    
I am using the dialog that contains buttons Print, Cancel and Apply. Regardless to your operating system.

I tried something like:

Button btP = (Button)printDialog1.Container.Components["Print"];

but there`s error: printDialog1.Container is null

I can`t find the names of the buttons,... on printdialog.
marcel zol 4-Nov-12 6:39am    
It` just like this one:
http://www.functionx.com/dlgboxes/print3.gif

That's not going to be easy, and it may be a very, very silly idea.

Certainly, on my system (vanilla Win7) the dialog that results from PrintDialog.ShowDialog contains no "Apply" button - just "OK" and "Cancel" so disabling or hiding the "Print" button won't work.

If you need a dialog that you can customise, then I would strongly suggest creating your own, rather than relying on hacking into features which may not be there in the future.
 
Share this answer
 
Print, Cancel, Apply? I don't even have that on my PrintDialog.

But maybe this articlel on hacking FontDialog can get you started. But I strongly suggest you create your own PrintDialog[^]
 
Share this answer
 
This may help you to use print dialog and access the printing here[^]

And for button apply action you can use runtime events control of button here is a sample here[^]
for hiding buttons and showing them you can apply show and hide property of buttons.

I hope it helps you a bit
 
Share this answer
 
Comments
Shaikh Irfan 28-Oct-13 10:52am    
How can I Check Print Preview Dialog's print Button Event...???

For Example :

I wanna print the page only one time and when second time user click on Print Preview Dialog's Print Button then I will restrict the user......
Abhishek Pant 24-Nov-13 2:43am    
Generate another event in last event to dispose the buttons after click event.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900