xp系统,点击确定打印后,直接关闭程序,并为抛出异常
try { PrintDialog pd = new PrintDialog(); FlowDocument fl = null; // pd.ShowDialog(); if (pd.ShowDialog() == true) { try { fl = (FlowDocument)(Application.LoadComponent(new Uri("/PrintTable1.xaml", UriKind.RelativeOrAbsolute)) as UserControl).Content; } catch (Exception ex) { MessageBox.Show(ex.Message); } try { pd.PrintDocument(((IDocumentPaginatorSource)fl).DocumentPaginator, "Order Document"); } catch(Exception ex) { MessageBox.Show(ex.Message); }
} } catch (Exception ex) { MessageBox.Show(ex.Message); }
转载于:https://www.cnblogs.com/Linc2010/p/3420667.html