Hi,
How to cancel the tab key in the event textbox1_KeyPress or textbox1_KeyDown in windows forms? When pressing the tab key in textbox1, i want the focus remaining on textbox1.
I tried this but it doesn't work: textbox1 loses the focus.
Thanks
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Tab)
{
ActiveControl = textBox1;
return;
}
Amit MohantyPosted Aug 2, 2022, 12:43 PM
Valerie MeunierPosted Aug 7, 2022, 2:12 PM
Guest UserPosted Aug 2, 2022, 12:38 PM