Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Populate a combo box with installed printers

Posted on 2009-07-09
2
Medium Priority
?
311 Views
Last Modified: 2012-05-07
I have had a look around for this and although it does seem possible i cant seem to find it. I am using VB2005.net and i want to populate a combobox with a list of installed printers. How can i do it.
Most things i have read say start with DIM DEV as PRINTER but printer is not avaliable as an option

Any ideas as this is urgent
0
Comment
Question by:bostonste
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 2000 total points
ID: 24813815
Loop through the PrinterSettings.InstalledPrinters collection adding the printers to a ComboBox
http://www.vb-helper.com/howto_net_list_printers.html
Imports System.Drawing.Printing
 
Private Sub Form1_Load(ByVal sender As Object, ByVal e As _
    System.EventArgs) Handles MyBase.Load
    Dim pkInstalledPrinters As String
 
    ' Find all printers installed
    For Each pkInstalledPrinters In _
        PrinterSettings.InstalledPrinters
        cboInstalledPrinters.Items.Add(pkInstalledPrinters)
    Next pkInstalledPrinters
 
    ' Set the combo to the first printer in the list
    cboInstalledPrinters.SelectedIndex = 0
End Sub

Open in new window

0
 

Author Closing Comment

by:bostonste
ID: 31601600
Thank you that was perfect
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question