How to make Enter on a TextBox act as TAB button

后端 未结 12 2511
迷失自我
迷失自我 2020-12-25 13:10

I\'ve several textboxes. I would like to make the Enter button act as Tab. So that when I will be in one textbox, pressing Enter will move me to the next one. Could you plea

12条回答
  •  时光说笑
    2020-12-25 14:13

    I use this code in one of the text box keydown event

    if (e.KeyData == Keys.Enter)
    {
         e.SuppressKeyPress = true;
         SelectNextControl(ActiveControl, true, true, true, true);
    }
    

    Unable handle this keydown event for all text boxes in my form. Suggest something. Thanks

提交回复
热议问题