2011年7月4日 星期一
取印表機
CODE:
Imports System.Drawing
Imports System.Data
Imports System.Drawing.Printing
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call OsGetPrinter(ComboBox1)
End Sub
Private Sub OsGetPrinter(ByVal cmbprint As ComboBox)
Try
cmbprint.Items.Clear()
For Each rprint As String In PrinterSettings.InstalledPrinters
cmbprint.Items.Add(rprint)
Next
If cmbprint.Items.Count >= 0 Then
cmbprint.SelectedIndex = 0
End If
Catch ex As Exception
MessageBox.Show(ex.Message + Chr(13) + Chr(10) + ex.Source)
End Try
End Sub
End Class
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言