인쇄 및 프린터 설정.

네크 2014.02.13 21:51:26 *: Public Class Form1

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

If RichTextBox1.Text = "" Then
MsgBox("글자를 입력하셔!!!")
Else
PrintPreviewDialog1.ShowDialog()
End If
End Sub

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim font1 As New Font("arial", 16, FontStyle.Italic)
e.Graphics.DrawString(RichTextBox1.Text, font1, Brushes.Black, 100, 100)
End Sub

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

인쇄시 프린터 선택 및 인쇄하기