Reader Level:
ARTICLE

How to Get Printers Listing in C#

On June 08, 2007 Articles | How do I
The code snippet in this how do I shows you how to get all available printers in C#.
  • 0
  • 0
  • 63576

Import System.Drawing.Printing namespace in your application.

Add a DropDownList and change its name to printersList and write this below code on Form's load event handler.

private void Form1_Load (object sender, System.EventArgs e)

{

foreach (String printer in PrinterSettings.InstalledPrinters)

{

printersList.Items.Add (printer.ToString());

}

}

The DropDownList will show all printers available on your network.

Mahesh Chand

Mahesh Chand is founder of C# Corner. C# Corner founded in 1999 is a FREE member contributions based open platform for developers to solve problems, learn new technology and hang out.  M...

  • 1rank
  • 71M readers
  • 9times
COMMENT USING

Trending up