将回车键转换为Tab键

实现效果:

  

知识运用:

  KeyEventArgs类的KeyValue属性

  public int KeyValue {get;}      //获取KeyDown或KeyUp事件的键盘值

  SendKeys类的Send方法

实现代码:

        private void textBox2_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == 13)
            {
                SendKeys.Send("{TAB}");
            }
        }

猜你喜欢

转载自www.cnblogs.com/feiyucha/p/10290075.html