如果我運行此代碼,並按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?
我能做些什麼WebBrowser.ShowPrintDialog?它返回一個void而不是DialogResult。 – sooprise 2011-02-15 18:55:49