private void button1_Click_1(object sender, EventArgs e) { InitializePrintPreviewDialog(); PrintDocument1.DefaultPageSettings.Landscape = false; PrintDocument1.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("Hibro", 120, 85); PrintPreviewDialog1.Document = PrintDocument1; PrintPreviewDialog1.ShowDialog(); }
public void PrintOut(string qrStr, string url, string msg) { pictureBox1.Image = PrintQRCode(qrStr); textBox1.Text = url; //textBox2.Text = msg; //printDocument1.PrintPage += PrintPage; //printDialog1.Document = printDocument1; //PrintPreviewDialog1.Document = printDialog1.Document; PrintPreviewDialog1.Document = printDocument1; PrintPreviewDialog1.Show(); }
private void button1_Click(object sender, EventArgs e) { try { PrintPreviewDialog1.Document = PrintDocument1; PrintPreviewDialog1.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString(), "Error"); } }
private void PreviewToolStripMenuItem_Click(object sender, System.EventArgs e) { try { PrintPreviewDialog1.Document = PrintDocument1; PrintPreviewDialog1.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString(), "Error"); } }
private void btnPrint_Click(object sender, EventArgs e) { if (IsDiagramaAberto()) // Set the PrintDocument object's name to the selectedNode // object's tag, which in this case contains the // fully-qualified name of the document. This value will // show when the dialog reports progress. { document.DocumentName = frmProj.frmDiagLadder.Name; } // Set the PrintPreviewDialog.Document property to // the PrintDocument object selected by the user. PrintPreviewDialog1.Document = document; // Call the ShowDialog method. This will trigger the document's // PrintPage event. PrintPreviewDialog1.ShowDialog(); }
private void btnPreview_Click(object sender, EventArgs e) { PrintPreviewDialog1.ShowDialog(); PrintPreviewDialog1.Document = PrintDocument1; }
private void btnPrintPreview_Click(System.Object sender, System.EventArgs e) { PrintPreviewDialog1.ShowDialog(); }