Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printing a string

Status
Not open for further replies.

jazzmaster111

Programmer
May 2, 2005
25
0
0
MX
Hi:

How can I send a string to the printer in order it prints this string?

Thanks!!
 
add a printdocument to your form

add a print button
do this in the click event

Code:
printdocument2.print

to make it simple

and add this to the printdocument printpage event

Code:
Private Sub PrintDocument2_PrintPage(ByVal sender As Object, ByVal e As Drawing.Printing.PrintPageEventArgs) Handles PrintDocument2.PrintPage
        Dim documentfont As New System.Drawing.Font("Arial", 8, FontStyle.Bold)
        Dim documentbrush As New System.Drawing.SolidBrush(System.Drawing.Color.Black)
        e.Graphics.DrawString(stringtoprint, documentfont, documentbrush, 10, 10)
        Next
    End Sub

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top