Insert tabs in a text box

It will be simple, I am sure, but I could not find anything on Google about this. I have a Winforms application with a text box. When I press the TAB key, the cursor moves to the next control. Instead, I want the actual tab (or 4 spaces) to be inserted into my text box. What property am I missing?

+5
source share
1 answer

You must set the property AcceptsTabto trueon TextBox. This inserts the actual TAB character.

On the MSDN page:

The property Multilinemust also be true in order to get the TAB character in the control.

AcceptsTab true, CTRL + TAB, .

+9

All Articles