窗体中回车键代替Tab键

private void Form1_Load(object sender, EventArgs e)

        {

            this.KeyPreview = true;//让窗体接收键盘按键

        }

 

        protected override void OnKeyPress(KeyPressEventArgs e)

        {

            base.OnKeyPress(e);

            if (DesignMode) return;

            if (e.KeyChar == 13)

            {

                this.SelectNextControl(this.ActiveControl, true, false, true, true);

            }

        }

你可能感兴趣的:(tab)