本文整理汇总了C#中System.Windows.Forms.PrintPreviewDialog.Hide方法的典型用法代码示例。如果您正苦于以下问题:C# PrintPreviewDialog.Hide方法的具体用法?C# PrintPreviewDialog.Hide怎么用?C# PrintPreviewDialog.Hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.PrintPreviewDialog
的用法示例。
在下文中一共展示了PrintPreviewDialog.Hide方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PreviewAndPrint
public void PreviewAndPrint()
{
//ExStart
//ExFor:AsposeWordsPrintDocument
//ExSummary:Shows the Print dialog that allows selecting the printer and page range to print with. Then brings up the print preview from which you can preview the document and choose to print or close.
Document doc = new Document(MyDir + "Rendering.doc");
PrintPreviewDialog previewDlg = new PrintPreviewDialog();
// Show non-modal first is a hack for the print preview form to show on top.
previewDlg.Show();
// Initialize the Print Dialog with the number of pages in the document.
PrintDialog printDlg = new PrintDialog();
printDlg.AllowSomePages = true;
printDlg.PrinterSettings.MinimumPage = 1;
printDlg.PrinterSettings.MaximumPage = doc.PageCount;
printDlg.PrinterSettings.FromPage = 1;
printDlg.PrinterSettings.ToPage = doc.PageCount;
if (!printDlg.ShowDialog().Equals(DialogResult.OK))
return;
// Create the Aspose.Words' implementation of the .NET print document
// and pass the printer settings from the dialog to the print document.
AsposeWordsPrintDocument awPrintDoc = new AsposeWordsPrintDocument(doc);
awPrintDoc.PrinterSettings = printDlg.PrinterSettings;
// Hide and invalidate preview is a hack for print preview to show on top.
previewDlg.Hide();
previewDlg.PrintPreviewControl.InvalidatePreview();
// Pass the Aspose.Words' print document to the .NET Print Preview dialog.
previewDlg.Document = awPrintDoc;
previewDlg.ShowDialog();
//ExEnd
}