private void toolStripMenuItem_printPreview_Click(object sender, EventArgs e) { Cursor oldCursor = this.Cursor; this.Cursor = Cursors.WaitCursor; outputPrintFile(); CardPrintForm dlg = new CardPrintForm(); dlg.CardFilename = printFilename; // 卡片文件名 dlg.PrintPreviewFromCardFile(); this.Cursor = oldCursor; }
/// <summary> /// 打印预约 /// </summary> /// <param name="noteId"></param> private void PrintPreview(Note note) { Cursor oldCursor = this.Cursor; this.Cursor = Cursors.WaitCursor; string printTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); this.OutputPrintFile(note); CardPrintForm dlg = new CardPrintForm(); dlg.CardFilename = this._printFilename; // 卡片文件名 dlg.PrintPreviewFromCardFile(); this.Cursor = oldCursor; }
private void toolStripMenuItem_printPreview_Click(object sender, EventArgs e) { CardPrintForm dlg = new CardPrintForm(); dlg.CardFilename = "print.xml"; // 卡片文件名 dlg.PrintPreviewFromCardFile(); /* * if (printDialog_prep.ShowDialog(this) != DialogResult.OK) * return; * * try * { * outputPrintFile(); * printDocument_prep.PrinterSettings.PrinterName = printDialog_prep.PrinterSettings.PrinterName; * printPreviewDialog_prep.ShowDialog(this); * } * catch (Exception ex) * { * MessageBox.Show(ex.Message); * } */ }