C # RichTextBox Tab Size

I am using System.Windows.Forms.RichTextBox and the default tab size is 8 spaces. The RichTextBox itself is not that big and 8 spaces results in a lot of scrolling. Is there a way to do this 4 spaces. If it matters, the control is initially empty and the user starts typing stuff and the tabs should be shorter (4 spaces) when the user enters tabbed text.

I tried Resize Default Tab in RichTextBox and a few variations but no luck.

+2


a source to share


1 answer


Perhaps you should read carefully the answers you link to.

You cannot set tabs for "RichEdit", but only for selection inside RichEdit.



You need something like:

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

      

+2


a source







All Articles