Click here to Skip to main content
11,580,572 members (68,219 online)
Rate this: bad
good
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 22:42pm
Edited 4-Nov-12 0:02am
Nelek71.1K
v2
Comments
marcel zol at 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 at 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 at 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 at 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
0 Frankie-C 195
1 OriginalGriff 184
2 F-ES Sitecore 80
3 Andy Lanng 75
4 Afzaal Ahmad Zeeshan 75
0 OriginalGriff 1,108
1 Sergey Alexandrovich Kryukov 785
2 Abhinav S 622
3 F-ES Sitecore 500
4 Suvendu Shekhar Giri 433


Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 4 Nov 2012
Copyright © CodeProject, 1999-2015
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