Printing in VB.NET
By Mike Gold 06/25/2003
Download
Using components is the difference between writing an application in one week vs. an application in a few hours. Printing is all carried out through components included in the toolbox. The main component that talks to the printer is the PrintDocument component. To use this component, just call the Print function and intercept the PrintPage event. Below are the routines that do this:
Protected Sub PrintFile_Click(sender As Object, e As System.EventArgs)
printDialog1.Document = ThePrintDocument
Dim strText As String = Me.richTextBox1.Text
myReader = New StringReader(strText)
If printDialog1.ShowDialog() = DialogResult.OK Then
Me.ThePrintDocument.Print()
End If
End Sub 'PrintFile_Click
More of this article at vbdotnetheaven
Last Updated:Thursday, September 02, 2010By:alferoSource#
with your OpenID.
If you do not know what OpenID is,