Sunday, April 14, 2019

RichTextBox should be empty before setting tabs

I've been trying to get the Windows Forms RichTextBox control to use specified tab stops for alignment purposes. Sometimes my application needs to update these while there's text in the box. As the name suggests, SelectionTabs affects the tab stops in the current selection, so all text would need to be selected first before changing it. Even that's given me trouble, though. My current strategy is to clear the text box using ResetText, setting SelectionTabs, putting the text back, and restoring the SelectionStart.

No comments:

Post a Comment