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?
Try setting the
SelectionTabsproperty before putting anything into the text box (and/or selecting anything).See Modifying default tab size in RichTextBox.