Using RichTextBox SelectionTabs property in winforms
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
_richTextB开发者_Python百科ox.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 SelectionTabs
property before putting anything into the text box (and/or selecting anything).
See Modifying default tab size in RichTextBox.
精彩评论