How can I show the print dialog in the Preview Dialog when I click to the Print button?
Currently, when I click in the print button, it just show this:
How can I show the print dialog in the Preview Dialog when I click to the Print button?
Currently, when I click in the print button, it just show this:
Using the PrintDialog works fine for me...
new PrintDialog().ShowDialog();
I think what you are actually using is:
printDocument1.Print();
but this won´t show up the dialog, you want to use ;)
This is by design. The PrintPreview dialogue uses the Windows default printer. It has to know what printer driver to use to render the image. The Print dialogue allows you to change printers and settings. You can't change printers or settings in PrintPreview but the solution below gets around that by showing the Print dialogue first and then PrintPreview, although I have not tested the code myself. How to present print settings from print preview? Here's the sample code they provide in this solution:
private void previewButton_Click(object sender, EventArgs e)
{
PrintDialog printDialog = new PrintDialog();
if (DialogResult.OK == printDialog.ShowDialog())
{
PrintPreviewDialog printPreview = new PrintPreviewDialog();
printPreview.Document = printIssues;
// this is were you take the printersettings from the printDialog
printPreview.Document.PrinterSettings = printDialog.PrinterSettings;
printIssues.DefaultPageSettings.Landscape = true;
printPreview.ShowDialog();
}
}