472,986 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,986 software developers and data experts.

PrintPreviewDialog Print Button

I am using PrintPreviewDialog to preview a file. There is a button that the
user can press, which seems to print the file to the default printer. I would
like to capture a click on that button so that I can present a PrintDialog,
print some files in a special way, etc. But there does not seem to be an
event among the PrintPreviewDialog members to do this? Or perhaps I missed
it? I would appreciate any suggestions. Thanks.

Apr 12 '06 #1
2 9764
PrintPreviewDialog is strangely a closed architecture. It's terribly
difficult to inherit from it and change its behaviour. I wanted to do
the same thing you've done, and I saw only two options:

1. Create my own PrintPreviewDialog. After all, PrintPreviewDialog is
just a PrintPreviewControl wrapped in a window with some buttons on it.
In fact, I have no idea why the folks at Microsoft just didn't publish
the code to PrintPreviewDialog and open it wide up, since it's probably
just a couple of hundred lines of code. Nonetheless, it seemed a lot of
work.

2. I inherited from PrintPreviewDialog and added a File menu with a
Print option. _that_ option brings up the print dialog. If the user
hits the printer button it still just prints to the default printer.

Apr 12 '06 #2
That's what I thought, but I could not really believe it was so. I was going
to use a PrintPreviewControl, but then I would have to write the other
buttons, I assume. But it sounds like that is the best choice. Thanks for the
help.
"Bruce Wood" wrote:
PrintPreviewDialog is strangely a closed architecture. It's terribly
difficult to inherit from it and change its behaviour. I wanted to do
the same thing you've done, and I saw only two options:

1. Create my own PrintPreviewDialog. After all, PrintPreviewDialog is
just a PrintPreviewControl wrapped in a window with some buttons on it.
In fact, I have no idea why the folks at Microsoft just didn't publish
the code to PrintPreviewDialog and open it wide up, since it's probably
just a couple of hundred lines of code. Nonetheless, it seemed a lot of
work.

2. I inherited from PrintPreviewDialog and added a File menu with a
Print option. _that_ option brings up the print dialog. If the user
hits the printer button it still just prints to the default printer.

Apr 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Randy | last post by:
Hello all, I'm trying to print using PrintPreviewDialog. What's happening is that the PrintPreviewDialog shows the correct information to be printed, but when I click the print icon, it prints a...
3
by: sachin | last post by:
How to customize PrintPreviewDialog, such that, addition of a new button, change the functionality of existing button should be possible programatically. Sample code will help a lot. Moreover, what...
0
by: Harry J. Smith | last post by:
I am using the PrintPreviewDialog Window Form from the Toolbox. It displays my RichTextBox contents correctly, but when I click on the Print icon on this form it prints one blank page and no text....
1
by: gabriel | last post by:
Hi all, I've got a problem with a PrintPreviewDialog. It shows my document correctly but when I try to print I only get the last page. Now when I use the print function of my document directly...
1
by: jacopomeucci | last post by:
hi all. I've a problem with PrintPreviewDialog in c#. I've done a form with a ListViewControl and i tried to print the data contents in this listview. I've read the ListViewControl via a...
0
by: Nina | last post by:
Hi there, I use PrintPreviewDialog to preview text of a textbox. It shows pages of text very well in PrintpPreviewDialog. But when I click the Print button on the dialog, it prints one blank...
10
by: choupi | last post by:
Hello, Is there a way to call a printDialog from a printPreviewDialog (from print icon for example)? Indeed, the print icon in the printpreviewdialog prints directly the document without...
0
by: ppeterkin | last post by:
I customized a PrintPreviewDialog by adding a button to it's toolstrip that opens up a PageSetupDialog. The problem is changes made to the page setup are not passed to the PrintPreviewDialog until...
0
by: sunny123 | last post by:
How Can i set the print icon in the printpreviewdialog to go to the printdialog? when I click on Report button in my application it'll open the report in print preview screen. There when I click...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.