Hi, I have vb.net application
In the form there are 2 RichtextBox.
To print the data in richtextbox I am using e.graphics method.
This is my code to print them....
The size of printing Richtextbox are fixed..
If Richtextbox1 has more data than the print area , then print does show more data.
So if possible that if RichTextBox1 has more data then it automatically shift down the RichTextBox2.OR as long as the user enter the data , the RichtextBox2 shifts automatically down....
Please help....
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim font1 As Font = New Drawing.Font("Arial", 11, FontStyle.Bold)
Dim font2 As Font = New Drawing.Font("Microsoft Sans Serif", 10)
Dim formatter As StringFormat = New StringFormat()
formatter.LineAlignment = StringAlignment.Near
formatter.Alignment = StringAlignment.Near
Dim rectangle4 As RectangleF = New RectangleF(150, 340, 600, 60)
e.Graphics.DrawString(Me.RichTextBox1.Text, font1, Brushes.Black, rectangle4, formatter)
Dim rectangle5 As RectangleF = New RectangleF(150, 740, 600, 60)
e.Graphics.DrawString(Me.RichTextBox2.Text, font1, Brushes.Black, rectangle5, formatter)
End sub