473,785 Members | 2,819 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PrintPreviewDia log Print Button

I am using PrintPreviewDia log 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 PrintPreviewDia log members to do this? Or perhaps I missed
it? I would appreciate any suggestions. Thanks.

Apr 12 '06 #1
2 9875
PrintPreviewDia log 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 PrintPreviewDia log. After all, PrintPreviewDia log is
just a PrintPreviewCon trol 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 PrintPreviewDia log 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 PrintPreviewDia log 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 PrintPreviewCon trol, 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:
PrintPreviewDia log 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 PrintPreviewDia log. After all, PrintPreviewDia log is
just a PrintPreviewCon trol 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 PrintPreviewDia log 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 PrintPreviewDia log 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
5870
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 blank page. If I comment out the printPreviewDialog1.ShowDialog(); and just do a printDocument1.Print(); instead, it prints all the pages like a champ. Anyone know what I'm doing wrong? Thanks
3
22978
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 happens before the document gets displayed in PrintPreviewDialog, i.e. whether entire document gets copied in printer driver spool or only 1 or 2 pages? please guide regards
0
1597
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. How can I fix this to print the text that is being displayed? Here is the code I use to bring up the form: string stringText = helpTextOut.Text;
1
2927
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 it print's correctly. I've overriden the OnPrintPage function of PrintDocument and for as far as I can see I've correctly set he HasMorePages property. Does anyone have an idea on how to fix this, or what I'm forgetting.
1
1702
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 WHILE cicle and i've done document then i've send it to the PrintPreviewDialog...end it seems to be perfect but when i click the printer button on the PrintPreviewDialog
0
1575
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 page. Please help me to make the print button to print the text in the preview? Thanks in advance. Nina
10
15334
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 lunching the printdialog (i.e. the user can't choose the print parameters). Thanks a lot.
0
1890
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 I close and reload it. How do I enable these changes to immediately show up in the print preview. See Code Below. Paul Private Sub ToolStripMenuItem2_Click(ByVal sender As System.Object,
0
1220
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 the print icon it will directly send the report to the printer. Before report send to the printer i want to give the option for selecting printer by showing print dialog. This is very urgent please help me. Thanks in advance
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10324
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10090
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.