Quote:
Originally Posted by tlhintoq
Could you post:
A) The code you are using to fill the RichTextBox
B) The code you are using to call the PrintPreview
I have replaced the richtext box with labels and textboxes. Now I am printing the contents of each control seperately. The code I am using now is below. This works to some extent but the alignment is not proper. Is there any other way of doing this.
- Private Sub Print_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs)
-
Dim Page As String
-
Page = Me.Label1.Text
-
e.Graphics.DrawString(Page, Label1.Font, Brushes.Black, Me.Label1.Location.X, Me.Label1.Location.Y)
-
-
Page = Me.Label2.Text
-
e.Graphics.DrawString(Page, Label2.Font, Brushes.Blue, Me.Label2.Location.X, Me.Label2.Location.Y)
-
-
Page = Me.TextBox1.Text
-
e.Graphics.DrawString(Page, TextBox1.Font, Brushes.Black, Me.TextBox1.Location.X, Me.TextBox1.Location.Y)
-
-
e.HasMorePages = False
-
-
End Sub
-