• We just launched and are currently in beta. Join us as we build and grow the community.

Get List of Available Printers

Gushorrt

Covert Data Collector
G Rep
0
0
0
Rep
0
G Vouches
0
0
0
Vouches
0
Posts
83
Likes
178
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 300 XP
Hi! this is my another tutorial that will get all the lists of available printer installed in your computer.

Now, let's start this tutorial!

1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to File, click New Project, and choose Windows Application.

2. Next, add only one Button named Button1 and labeled it as "Get Printers" and one ListBox named ListBox1 that will serve as the display in the lists of printers. You must design your interface like this:

printerdesign.png


3. Now put this code for your code module.
  1. Imports

    System.

    Drawing

    .

    Printing
  2. Public

    Class

    Form1

  3. Private

    Sub

    Button1_Click(

    ByVal

    sender As

    System.

    Object

    , ByVal

    e As

    System.

    EventArgs

    )

    Handles

    Button1.

    Click
  4. Dim

    index1 As

    Object
  5. For

    index1 =

    0

    To

    PrinterSettings.

    InstalledPrinters

    .

    Count
  6. ListBox1.

    Items

    .

    Add

    (

    PrinterSettings.

    InstalledPrinters

    .

    Item

    (

    index1)

    )
  7. Next
  8. End

    Sub
  9. End

    Class

Explanation:

We have imported first System.Drawing.Printing, this namespace provides print-related services for Windows Forms applications. When you print from a Windows Forms application, you create a new instance of the PrintDocument class, set properties, such as DefaultPageSettings and PrinterSettings, that describe how to print, and call the Print method to actually print the document. We have initialized a variable index1 that will start to 0 up to all the lists of installed printers. PrintDocument Class defines a reusable object that sends output to a printer, when printing from a Windows Forms application. Then the list of the printers will be added to the listview to display it all.

For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below and hire me.

Best Regards,

Engr. Lyndon R. Bermoy

IT Instructor/System Developer/Android Developer

Mobile: 09079373999

Telephone: 826-9296

E-mail:[email protected]

Visit and like my page on Facebook at: Bermz ISware Solutions

Subscribe at my YouTube Channel at: SerBermz


Download
You must upgrade your account or reply in the thread to view hidden text.
 

452,292

323,891

323,899

Top