Click here to Skip to main content
12,623,930 members (29,828 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# printing
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:

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 3-Nov-12 23:42pm
Updated 4-Nov-12 1:02am
Nelek110.5K
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
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

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[^]
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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
  Permalink  
Comments
Member 10266020 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 4 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100