VB.NET如何能将文本框中的内容原样打印 50
展开全部
Imports System.Drawing.Printing
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) 扮陆Handles Button1.Click
Try
Dim PDoc As New PrintDocument
AddHandler PDoc.PrintPage, 厅如顷AddressOf Me.PText
PDoc.Print()
Catch ex 橡贺As Exception
MessageBox.Show("error", ex.ToString)
End Try
End Sub
Private Sub PText(ByVal sender As Object, ByVal e As PrintPageEventArgs)
e.Graphics.DrawString(TextBox1.Text, New Font("Arial", 11, FontStyle.Regular), Brushes.Black, 120, 120)
e.HasMorePages = False
End Sub
End Class
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询