Home All Groups Group Topic Archive Search About

how to get PRINTERS NAMES ?

Author
28 Oct 2005 12:53 AM
pamelafluente
I need to load all the available printers
- including network ones - in a combobox.

Would anybody so kind as to show me how to do it? Thank you

-Pamela

Author
28 Oct 2005 1:52 AM
Tim Wilson
You can get a list of installed printers using the static
"InstalledPrinters" property of the PrinterSettings class.

using System.Drawing.Printing;

try
{
  foreach (string printer in PrinterSettings.InstalledPrinters)
  {
    this.comboBox1.Items.Add(printer);
  }
}
catch
{
  // ... handle exception ...
}

--
Tim Wilson
..NET Compact Framework MVP

<pamelaflue***@libero.it> wrote in message
Show quote
news:1130460815.534878.137250@g43g2000cwa.googlegroups.com...
> I need to load all the available printers
> - including network ones - in a combobox.
>
> Would anybody so kind as to show me how to do it? Thank you
>
> -Pamela
>
Author
28 Oct 2005 5:36 PM
pamelafluente
Thank you very much Tim. Very helpful!!

-Pamela

Tim Wilson (UNDERSCORE AT PERIOD) ha scritto:

Show quote
> You can get a list of installed printers using the static
> "InstalledPrinters" property of the PrinterSettings class.
>
> using System.Drawing.Printing;
>
> try
> {
>   foreach (string printer in PrinterSettings.InstalledPrinters)
>   {
>     this.comboBox1.Items.Add(printer);
>   }
> }
> catch
> {
>   // ... handle exception ...
> }
>
> --
> Tim Wilson
> .NET Compact Framework MVP
>
> <pamelaflue***@libero.it> wrote in message
> news:1130460815.534878.137250@g43g2000cwa.googlegroups.com...
> > I need to load all the available printers
> > - including network ones - in a combobox.
> >
> > Would anybody so kind as to show me how to do it? Thank you
> >
> > -Pamela
> >

AddThis Social Bookmark Button