By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,402 Members | 1,091 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,402 IT Pros & Developers. It's quick & easy.

PrintPreviewDialog Print Button

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.