|
|
|

|

|
Dicas
|

|
Visual Basic.Net (ActiveX/Controles/DLL)
|
|
 |
Título da Dica: Função Genérica para Carregar Impressoras Instaladas
|
 |
|
|
Postada em 14/7/2004 por ixeyc
Public Sub CarregaImpressora(Combo As ComboBox) Combo.Clear iPrinter = 0 For Each prtPrinter In Printers sPrinter = prtPrinter.DeviceName & " em " If Right$(prtPrinter.Port, 1) = ":" Then sPrinter = sPrinter & Left$(prtPrinter.Port, Len(prtPrinter.Port) - 1) Else sPrinter = sPrinter & prtPrinter.Port End If Combo.AddItem sPrinter Combo.ItemData(Combo.NewIndex) = iPrinter If (prtPrinter.DeviceName = Printer.DeviceName And Printer.Port = prtPrinter.Port) Then Combo.ListIndex = Combo.NewIndex mvarPrinter = iPrinter End If iPrinter = iPrinter + 1 Next End Sub
Chame a função informando o objeto:
ex: CarregaImpressora(cmbImpressoras)
|
|
|
|

|