Code:
Imports System.Drawing.Printing
Public Class Form1
Private Sub printtext(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
ev.Graphics.DrawString(TextBox1.Text, New Font("arial", 11, FontStyle.Regular), Brushes.Black, 120, 120)
ev.HasMorePages = False
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim PrintDoc As New PrintDocument
AddHandler PrintDoc.PrintPage, AddressOf Me.printtext
PrintDoc.Print()
Catch ex As Exception
MessageBox.Show("Sorry won't print", ex.ToString())
End Try
End Sub
End Class
I am trying to enter the carriage return and line feed into this area of the text TEXTBOX1.TEXT & VBCRLF but it does not work what do I need to do.
Bookmarks