WinForms C#在show PrintDialog

时间:2015-10-06 10:10:48

标签: c# winforms printdialog

我想在WinForms中显示PrintDialog之前添加所有PrinterSetting值。例子:我想设置副本= 4:

PrintDialog.PrinterSettings.Copies = 4;
DialogResult result = PrintDialog.ShowDialog();

但副本显示仍然是1.我该怎么办?

1 个答案:

答案 0 :(得分:2)

通过将PrintSettings分配给PrintDialog的实例来执行此操作。

using (var printDialog = new PrintDialog())
{
    var printSettings = new PrinterSettings {Copies = 4};
    printDialog.PrinterSettings = printSettings;
    printDialog.ShowDialog();
}

这会产生以下对话框。 enter image description here