Mat*_*att 1 .net c# printing winforms
我有以下代码来抛出打印机对话框,但无论我选择什么打印机,它总是打印到默认打印机.
如何为用户选择的打印机分配?(从对话窗口)
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();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3127 次 |
| 最近记录: |