如果我运行此代码,并在 PrintDialog 上按取消,它仍然会打印。如何判断使用是否按下取消?
PrintDocument document = new PrintDocument();
PrintDialog dialog = new PrintDialog();
dialog.ShowDialog();
document.PrinterSettings = p.PrinterSettings;
document.Print();
附录
WebBrowser w = new WebBrowser();
w.ShowPrintDialog(); //.ShowPrintDialog returns a void, how can I deal with this?