У меня есть ListBox, в котором отображаются все принтеры, которые я могу найти в клиенте Windows.
Код: Выделить всё
List lstPrinters = new List();
foreach (var item in PrinterSettings.InstalledPrinters)
{
MyPrinterClass d = new MyPrinterClass();
d.printerName = item.ToString();
lstPrinters.Add(d);
}
Код: Выделить всё
public class MyPrinterClass
{
public string imageSource { get; set; }
public Bitmap imageBmp { get; set; }
public string printerName { get; set; }
public List
paperSources { get; set; }
}
What I tried:
By PrinterSettings.InstalledPrinters I am able to get the printerNames but there seems to be no access to other data.
by PrinterSettings.PaperSources I am able to receive the PaperSources but I am coming from a PrintDocument. So the data isnt related to the selected installed printer from my ListBox.
What I expected:
A printer class similar to the universal windows solution given by the MS Guides.
What I could do:
I could create a universal windows solution and hand over the data but its my least favorite option to do so.
Источник: https://stackoverflow.com/questions/781 ... rintername