Results 1 to 3 of 3

Thread: How do i create a list box that shows all printers

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Wellington NZ
    Posts
    153

    Question

    I would like to ask you if you know how to create a list box that shows all the availible printers is a list box, the design that i would like to create is based on the printer options in Microsoft Word. If you know how then could you let me know.

    Rohan

  2. #2
    Lively Member Ishamel's Avatar
    Join Date
    Nov 1999
    Location
    Edinburgh, Scotland
    Posts
    112
    I think this is what you are after.

    Code:
    Dim objPrinter As Printer
    
    For Each objPrinter In Printers
        List1.AddItem objPrinter.DeviceName
    Next
    Hope this helps.

  3. #3
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Not to much of a problem

    If you want it to look like word then you will need to use a comboBox.

    Code:
    Dim myPrinter As Printer
        
    For Each myPrinter In Printers
      Combo1.AddItem myPrinter.DeviceName
    Next
    Hope this helps.
    Iain, thats with an i by the way!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width