469,898 Members | 1,599 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

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 9483
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Harry J. Smith | last post: by
1 post views Thread by gabriel | last post: by
1 post views Thread by jacopomeucci | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.