In my C# Project I have 2 print functions. One that prints the document directly and another that presents a preview to the user and prints if the user chooses to do so.
While both methods are working, the direkt print version presents the print settings window before it prints the document.
private void printButton_Click(object sender, EventArgs e)
{
PrintDialog printDialog = new PrintDialog();
printDialog.Document = printIssues;
printDialog.UseEXDialog = true;
if (DialogResult.OK == printDialog.ShowDialog())
{
printIssues.DocumentName = "Some Name";
printIssues.DefaultPageSettings.Landscape = true;
printIssues.Print();
}
}
private void previewButton_Click(object sender, EventArgs e)
{
PrintPreviewDialog printPreview = new PrintPreviewDialog();
printPreview.Icon = Properties.Resources.favicon;
printPreview.Document = printIssues;
printIssues.DefaultPageSettings.Landscape = true;
((Form)printPreview).WindowState = FormWindowState.Maximized;
printPreview.ShowDialog();
}
The second Version where I present the preview first, once I click the print button the document gets printed on the Default Printer without presenting the Settings window. I've tried some things and searched quiet some time but couldn't find anything that helped me.
I appreciate your help.