dcsimg

Fill a combobox with current defined printers

WEBINAR:
On-Demand

Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame


Add this code to an empty form with a combobox or list box on it:
private Sub Form_Load()
    Combo1.Clear
    m_GetPrinters Combo1
    Combo1.ListIndex = 0

End Sub

'-----------------------------------------------------------------
' looking for all printers and filling objListOrCombo
'-----------------------------------------------------------------
public Sub m_GetPrinters(byref objListOrCombo as Object)
    Dim objPrinter          as Printer
    Dim intNbOfPrinters     as Integer

    intNbOfPrinters = Printers.Count - 1
    for Each objPrinter In Printers
        objListOrCombo.AddItem objPrinter.DeviceName
    next
End Sub


Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date