C#Winform RichTextBox分页符或其他内容 [英] C# winform richtextbox page break or something
本文介绍了C#Winform RichTextBox分页符或其他内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好...我想知道是否可以为Richtextbox插入分页符...或设置RichTextBox的Verticall滚动条的大小..
感谢
hello... i want to know if it is posible to insert a page break for a richtextbox... or to set the size of the verticall scrollbar of a richtextbox..
thanks
推荐答案
默认情况下不存在分页功能,但是您可以通过添加BlankLines来自己进行管理.
只需将文本框的高度转换为行数即可(我认为1行需要10 Px,您可以计算出来).现在,基于文本框的行数,添加剩余的空白行以进行分页. (假设您添加了三行,并且文本框需要10行,因此,您需要添加7条空行,然后显示新的行区域.)
我还没有尝试过,但是它应该可以工作,通过"\ n \ f \ n"来表示RichText框中的Word PageBreak演示文稿.我的意思是您可以编写richtextbox1.Text ="Page1-PageBreak \ n \ f \ n Page2",它表示Word文件中的分页符.
希望你能骑上它.
问候
鲁西
By default Page Break Functionality is not there but you can manage by your own with adding BlankLines.
Just convert height of your text box to number of lines (I think 1 line takes 10 Px, you can calculate it). Now based on number of lines for a text box add remaining blank lines to do a page break. (Say you added three lines and your text box require 10 lines so, you need to add 7 blank lines and then it shows new line area.)
I have not tried but it should work, by the way Word PageBreak presentation in RichText box is denoted by "\n\f\n". I mean you can write richtextbox1.Text = "Page1 - PageBreak \n\f\n Page2" which representa a page break in Word file.
Hope you should ride on it.
Regards
Rushi
这篇关于C#Winform RichTextBox分页符或其他内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文