winform按下回车光标跳转到下一个控件

key press event  

if (e.KeyChar == 13)
            {
                if (this.ActiveControl.Text.Trim() == "")
                {
                    //this.ActiveControl.Focus();

SendKeys.Send("{F4}");
                }
                else
                {
                    this.SelectNextControl(this.ActiveControl, true, true, true, true);
                }
            }

posted @ 2013-03-14 22:34  feidaochuanqing  阅读(610)  评论(0编辑  收藏  举报