我有下面的代码来抛出一个打印机对话框,但无论我选择哪种打印机,它总是打印到默认打印机。在C#窗口应用程序中打印问题 - 总是打印到默认打印机
如何分配用户选定的打印机? (从对话窗口)
PrintDialog pdlg = new PrintDialog();
// Show the PrintDialog
if (pdlg.ShowDialog() == DialogResult.OK)
{
PrintDocument pd = new PrintDocument();
pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
// Associate PrintDocument object with the PrintDialog
pdlg.Document = pd;
// Print with the new PrinterSettings
pd.Print();
}
这个伎俩 - 非常感谢! – Matt 2010-02-23 20:57:56
不客气。这个问题总是咬我。 – dar7yl 2010-02-23 21:08:48