views:

130

answers:

1

When I am viewing a document in Wordpad (or Word) the text is word wrapped around the document boundaries. Altough when I using the RTF string in a RichTextBox the text is wrapped around the control border. This means when I change the size of the window the wordwrapping changes.

Is there something I can do about this ? (some kind of mode I have to set the RichTextBox into)

Or is there are free / commercial RichTextBox which does exactly that ?

(In former times you could download the Wordpad sourcecode what I did - but I can't get it to run - is this the correct version - or does this help me at all ?)

+1  A: 

You can control that with the RightMargin property. You'll have to figure out what your desired Width is in pixels. The default is 0 which means follow the control.

Additional: If you only need a ReadOnly view you can use a PrintPreview Control. See this article about how to get the Page transitions working.

Henk Holterman
sounds.. challenging. Any code / idea for doing this ? (I am thinking in terms of xx mm * yy mm). Am I correct that the page size is not saved in the RTF ?
bernhardrusch
Sounds like you want Word's 'Page Layout', afaik the RichTextBox only does the 'Normal' view.
Henk Holterman