开发者

Using RichTextBox SelectionTabs property in winforms

开发者 https://www.devze.com 2022-12-31 23:13 出处:网络
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.

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.

0

精彩评论

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