Wpf System.Windows.Controls.PrintDialog предварительно выбранный PrintQueue (принтер) игнорируется ⇐ C#
-
Anonymous
Wpf System.Windows.Controls.PrintDialog предварительно выбранный PrintQueue (принтер) игнорируется
I want to show the PrintDialog from System.Windows.Controls. I also want to preselect a specific printer in some cases. I tried it this way:
PrintDialog printDialog = new PrintDialog(); printDialog.PrintQueue = new PrintQueue(new PrintServer(), printerName); and also this way:
PrintServer printServer = new PrintServer(); PrintDialog printDialog = new PrintDialog(); printDialog.PrintQueue = printServer.GetPrintQueue(printerName); But in both cases the default printer is preselected, not the printer I defined in printerName. Anyone an idea why this can be or what I can do better?
Edit: There is this switch in Windows 10 and Windows 11 where Windows controls the behaviour of the default printer. When I ACTIVATE this, then I can control which printer is shown, when I deactivate this, the (in the OS settings) manually selected default printer is always selected in the dialog. Can't this be overridden?
Источник: https://stackoverflow.com/questions/781 ... er-is-igno
I want to show the PrintDialog from System.Windows.Controls. I also want to preselect a specific printer in some cases. I tried it this way:
PrintDialog printDialog = new PrintDialog(); printDialog.PrintQueue = new PrintQueue(new PrintServer(), printerName); and also this way:
PrintServer printServer = new PrintServer(); PrintDialog printDialog = new PrintDialog(); printDialog.PrintQueue = printServer.GetPrintQueue(printerName); But in both cases the default printer is preselected, not the printer I defined in printerName. Anyone an idea why this can be or what I can do better?
Edit: There is this switch in Windows 10 and Windows 11 where Windows controls the behaviour of the default printer. When I ACTIVATE this, then I can control which printer is shown, when I deactivate this, the (in the OS settings) manually selected default printer is always selected in the dialog. Can't this be overridden?
Источник: https://stackoverflow.com/questions/781 ... er-is-igno
Мобильная версия