0

当我从 Excel、Outlook 等打印时,会显示 3 台打印机。当我调用 PrintDialog1.ShowDialog() 时,它只显示默认打印机。如何显示所有可用的打印机?谢谢

4

1 回答 1

0

这应该会为您提供已安装打印机的列表,如果它们没有显示此代码,则可能是您需要更新驱动程序?

    Dim controller As New ServiceController("Spooler")
    If controller.Status = ServiceControllerStatus.Running Then
        'http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/fe615570-ce3e-419b-86fc-7f98aed71c8f
        For Each currentPrinter As String In System.Drawing.Printing.PrinterSettings.InstalledPrinters
            'now add the currentPrinter to a list ...                   
        Next
    End If
于 2013-11-14T12:33:41.197 回答