Tabs in a RichTextBox

  • Thread starter Thread starter SamSpade
  • Start date Start date
S

SamSpade

I think I've determined that when setting a RichTextBox's Text property to a
string that contains tabs, the tabs are ignored.

Can anyone confirm or deny this??



Thanks in advance


P.S. The reason I ask this is because I have a case where I type a tab and
it is effective, but if I set the Text property the tab is ineffective (or
so it seems).
 
Hi SamSpade,

I cannot confirm your problem.

richTextBox1 = "Hello World!";
richTextBox1 = "Hello\tWorld!";

Both works fine.
Note that Visual Studio will interpret tab as moving to the next property
so you have to use \t when using tab in the designer Text property.

Happy coding!
Morten Wennevik [C# MVP]
 
Thanks, Guess I'll have to keep trying until some other possibility occurs
to me.

Thanks again


Hi SamSpade,

I cannot confirm your problem.

richTextBox1 = "Hello World!";
richTextBox1 = "Hello\tWorld!";

Both works fine.
Note that Visual Studio will interpret tab as moving to the next property
so you have to use \t when using tab in the designer Text property.

Happy coding!
Morten Wennevik [C# MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top