老师们!请教怎么可以把电脑打印机读取到ComboBox1控件里面,然后打印的时候选那个打印机就选择那个打印机,感谢 感谢 !
目前只有打印的代码
麻烦老师了 感谢 感谢
Tables("产品标签窗口_Table1").Filter = "(规格<> '')"
e.Form.Page.Width = 100 '纸张宽度为100毫米
e.Form.Page.Height = 60 '纸张高度为120毫米
e.Form.Page.LeftMargin = 1 '设置左边距
e.Form.Page.RightMargin = 1 '设置右边距
e.Form.Page.TopMargin = 0.5 '设置上边距
e.Form.Page.BottomMargin = 10 '设置下边距
Dim grp As WinForm.GroupBox = e.Form.Controls("GroupBox3")
Dim doc As PrintDoc = e.Form.GernatePrintDoc(grp)
doc.PageSetting.Landscape = True '横向打印
Dim ps As new System.Drawing.Printing.PrinterSettings
ps.Copies = e.Form.Controls("NumericComboBox2").Text
doc.Print(ps) '打印
Forms("产品标签窗口").Controls("Button1").PerformClick
Dim cbo As WinForm.ComboBox= e.Form.Controls("ComboBox1")
For Each p As String in InstalledPrinters
cbo.items.add(p)
Next