Hi
As for code you're on your own, and as for a better answer I'm not sure but since the PrintPreviewDia log uses a PrintPreview Control and since this PrintPreview control exposes all the properties the PrintPreviewDia log gives you such as setting the count of pages to display in the preview, or zoom factor... you can create your own PrintPreviewDia log without much effort.
here's a code sample using the PrintPreviewDia log,
previewDialog.P rintPreviewCont rol.StartPage = 0; // set which page the preview shows
previewDialog.P rintPreviewCont rol.Zoom = 1.0; // your previews zoom factor
previewDialog.P rintPreviewCont rol.Columns = 2; //Sets the page count to display within the preview
now if you created a new windows form and dragged a PrintPreviewCon trol onto it, set this controls Modifier property to 'internal protected' or higher you can access these properties when you instantiate the form from the main form. Now even dragging a toolbar into this new form you can mockup the original design of the PrintPreviewDia log. You're pretty much done short of adding your buttons, and when you add your buttons you might consider giving their DialogResult property a DialogResult value {OK, Cancel,Yes, No, Retry,Ignore,.. .} this way you can call the ShowDialog method on this new form to display the modally (Top-most and in control) then you can as well check the user's button press action by checking the returned DialogResult property.
i.e.;
MyPrintPreview printForm = new MyPrintPreview ();
printForm.Print PreviewControl. Document = printDocument1; // Don't forget the you must attach a PrintDocument object to your Control!!!!
printForm.Print PreviewControl. StartPage = 0;
printForm.Print PreviewControl. Zoom = 1.0;
printForm.Print PreviewControl. Columns = 2;
if (DialogResult.O K == printForm.ShowD ialog())
...
Two thing's I'm sure you have probably done, is to make sure you have a PrintDocument object on the form and created the PrintPage event handler with the logic to actually compose your printed output. Without these you'll see nothing but grey or white depending on which of the two you have not done.
rgds,
Trent
"sachin" <an*******@disc ussions.microso ft.com> wrote in message news:E5******** *************** ***********@mic rosoft.com...
How to customize PrintPreviewDia log, 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 PrintPreviewDia log, i.e. whether entire document gets copied in printer driver spool or only 1 or 2 pages?
please guide
regards