刚刚做好了一个填写详细信息的窗体,想加一个按钮直接用打印机打出来。谢谢
參考答案:拉PrintDialog,PrintDocument两个控件到窗体上,然后在你自己的打印按钮上面添加事件:
Private Sub button1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim s As String = ""
s = TextBox1.Text'你的详细信息
e.Graphics.DrawString(s, New Font("Arial", 10, FontStyle.Regular), Brushes.Black, 150, 125)
End Sub
ok,可以了!