RichTextBox insert spaces

Joined
Nov 9, 2009
Messages
16
Programming Experience
Beginner
I have a situation where I have a report generated by a CAD application. It's plain text. The report comes out on landscape letter size paper. I need to format the report and insert a gap 15 charaters wide so the report can have whols punched down the center so it can go into a small field binder. I can read the file into the RichTextBox without any problems. I just cant figure out how to insert the gap. Here is how I'm bring the file into the RTF.

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
RichTextBox1.Font = New Font("Lucida Console", 10, FontStyle.Regular)
RichTextBox1.LoadFile(OpenFileDialog1.FileName, RichTextBoxStreamType.PlainText)

End If
End Sub

Thank you for any help.
-Phillip
 
I'm not quite sure where you're getting at... sure the content in RichTextBox can be indented (SelectAll, SelectionIndent), but perhaps it would be better to leave the rich document as is and print the report by means of honouring the page margins (I'm sure Wordpad has no problems with margins). There is an extended RichTextBox control available that can be used with the PrintDocument to print the RTB content properly here: Getting WYSIWYG Print Results from a .NET RichTextBox
In case it is simply the default page margins that need to be increased, can't this be done with the app that prints the report, for example Wordpad?
Anyway you have a few ideas here.
 
Thank you for the reply. However it's not the magins thats the problem. The binders that these reports in are made for a paper size of 8.5 x 5.5. So I need to reformat the text from the center out. So that when we physiclly splt the 8.5 x 11 into 8.5 x 5.5 we have room to punch wholes without messing up the text.

One 8.5 x 11 landscape becomes two 8.5 x 5.5

Hope this helps
 
Last edited:
Back
Top