I created a richTextBox and i noticed that when I press Tab key it is not doing anything. It is suppose to do some space but it do not.
How can i access it?
A RichTextBox is a better choice when it is necessary for the user to edit formatted text, images, tables, or other rich content. For example, editing a document, article, or blog that requires formatting, images, etc is best accomplished using a RichTextBox.
In C#, RichTextBox control is a textbox which gives you rich text editing controls and advanced formatting features also includes a loading rich text format (RTF) files. Or in other words, RichTextBox controls allows you to display or edit flow content, including paragraphs, images, tables, etc.
By default pressing tab moves focus to the next control. Setting AcceptsTab property of the RichTextBox to true
allows the RichTextBox to accept tab characters.
See this MSDN article on the AcceptsTab property.
First you need to set following properties of Richtextbox
richTextBox.Multiline = true;
richTextBox.AcceptsTab = true;
And in the keypress event of richtextbox you need to do following
if (e.KeyChar == 9)
{
e.Handled = false;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With