Answer the question
In order to leave comments, you need to log in
How to catch TAB press in C# WinForms?
Hello!
How can I make C# WinForms so that when focus is on a TextBox and TAB is pressed, a tab is inserted?
Answer the question
In order to leave comments, you need to log in
1 option
textBox2.Multiline = true;
textBox2.AcceptsTab = true;
private void textBox1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Tab)
{
textBox1.AppendText("\t");
e.IsInputKey = true;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question