private void PopulateInstalledPrintersCombo()
// Add list of installed printers found to the combo box.
// The pkInstalledPrinters string will be used to provide the display string.
for (int i = 0; i < PrinterSettings.InstalledPrinters.Count; i++)
pkInstalledPrinters = PrinterSettings.InstalledPrinters[i];
private void comboInstalledPrintersSelected()
PrintDocument printDoc = new PrintDocument();
// Set the printer to a printer in the combo box when the selection changes.
if (comboInstalledPrinters.SelectedIndex != -1)
// The combo box's Text property returns the selected item's text, which is the printer name.
printDoc.PrinterSettings.PrinterName = comboInstalledPrinters.Text;
Open in new window
IT issues often require a personalized solution. With Ask the Experts™, submit your questions to our certified professionals and receive unlimited, customized solutions that work for you.
Take hold of your future.