Winforms RichTextBox 页面大小?
当我在写字板(或 Word)中查看文档时,文本会围绕文档边界自动换行。 尽管当我在 RichTextBox 中使用 RTF 字符串时,文本会环绕在控件边框周围。 这意味着当我更改窗口的大小时,自动换行也会发生变化。
我能做点什么吗? (我必须将 RichTextBox 设置为某种模式)
或者是否有免费/商业 RichTextBox 可以做到这一点?
(以前你可以下载我所做的写字板源代码 - 但我无法让它运行 - 这是正确的版本 - 或者这对我有帮助吗?)
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 ?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 RightMargin 属性来控制它。 您必须弄清楚所需的宽度(以像素为单位)。 默认为0,表示跟随控制。
另外:如果您只需要只读视图,则可以使用 PrintPreview 控件。 请参阅本文了解如何实现页面转换。
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.