开发者

c# RichTextBox Tab size

I'm using System.Windows.Forms.RichTextBox and by default the tab size is 8 spaces. The RichTextBox itself is not that big and 8 spaces leads to a lot of scrolling. Is there any way to make it 4 spaces. I开发者_JAVA百科f it matters, the control is initially blank and the user starts entering stuff and the tabs have to shorter (4 spaces) as the user enters text with tabs.

I tried Modifying default tab size in RichTextBox and a few variations of it but no luck.


Maybe you should carefully read the answers you link to.

You cannot set the tabs for 'the RichEdit' but only for a selection inside the RichEdit.

You need something like:

rtb.SelectAll();  
rtb.SelectionTabs = new int[] { 100, 200, 300, 400 };
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜