_slient

导航

c#判断键盘按键

   private void txtNo_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == 13)             // 判断 按键的事件, 13 表示按下了 回车键
            {
                SendKeys.Send("{tab}");     // 模拟键盘再按一下 tab 键,  此方法 要先设定 TableIndex
            }

        }

 

posted on 2016-01-09 17:21  _slient  阅读(2404)  评论(0)    收藏  举报