Allow users to insert a TAB into a TextBox but not newlines

Posted by pbean on Stack Overflow See other posts from Stack Overflow or by pbean
Published on 2008-12-17T13:12:25Z Indexed on 2010/05/02 2:47 UTC
Read the original article Hit count: 470

Filed under:
|
|
|

I want to have a TextBox which does accept the TAB key (and places a TAB, ASCII 0x09, \t accordingly into the textbox) instead of jumping to the next control. The TextBox has a property AcceptsTab, which I have set to true but this does not give the desired result. It turns out the AcceptsTab property only works then Multiline is set to true as well. However I want to have a one-line TextBox which doesn't accept newlines.

© Stack Overflow or respective owner

Related posts about c#

Related posts about textbox