Wpf System.Windows.Controls.PrintDialog предварительно выбранный PrintQueue (принтер) игнорируетсяC#

Место общения программистов C#
Ответить Пред. темаСлед. тема
Anonymous
 Wpf System.Windows.Controls.PrintDialog предварительно выбранный PrintQueue (принтер) игнорируется

Сообщение Anonymous »


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
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «C#»