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