Enter key press in C#

前端 未结 14 855
臣服心动
臣服心动 2020-12-01 06:06

I tried this code:

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
    if (Convert.ToInt32(e.KeyChar) == 13) 
    {
        MessageBox.S         


        
14条回答
  •  温柔的废话
    2020-12-01 06:42

    private void Ctrl_KeyUp(object sender, KeyEventArgs e)
    {
        if (e.KeyCode == Keys.Enter)
        {
            this.SelectNextControl((Control)sender, true, true, true, true);
        }
    }
    

    Select all required textboxes; type in new Events name Ctrl_KeyUp.

    See YouTube by BTNT TV: https://www.bing.com/videos/searchq=c%23+how+to+move+to+next+textbox+after+enterkey&view=detail&mid=999E8CAFC15140E867C0999E8CAFC15140E867C0&FORM=VIRE

提交回复
热议问题