views:

98

answers:

1

In a winforms application, I'm using a RichTextBox and I'm trying to reduce the output from a '\t' to 4 spaces from whatever the default is. I have this in the form's OnLoad

 _richTextBox.Text = "1\t2\t3\t4\t5";
 _richTextBox.SelectAll();
 _richTextBox.SelectionTabs = new int[]  {100,200,300,400 };

I have a breakpoint before and after this snippet. The SelectionTabs is set to {int[0]} (empty int array) before and after the assignment. Can anyone tell me why my assignment is not going through?

+1  A: 

Try setting the SelectionTabs property before putting anything into the text box (and/or selecting anything).

See Modifying default tab size in RichTextBox.

NascarEd