0

如何在表格对齐的文档中打印两个或多个值

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    PrintDocument1.PrinterSettings.Copies = 2
    PrintDocument1.Print()

End Sub

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
    e.Graphics.DrawString(TextBox1.Text, TextBox1.Font, Brushes.Blue, 100, 100)
    e.Graphics.DrawString(TextBox2.Text, TextBox2.Font, Brushes.Blue, 100, 100)

End Sub

End Class
4

0 回答 0