zoukankan      html  css  js  c++  java
  • 回车键当Tab键使用

     #region 回车键当Tab键使用
            private void enter_KeyPress(object sender, KeyPressEventArgs e)
            {
                foreach (Control c in this.Controls)
                {
                    c.KeyPress += new System.Windows.Forms.KeyPressEventHandler(sendEnter);
                }
            }
            private void sendEnter(object sender, KeyPressEventArgs e)
            {
                if (e.KeyChar == (char)Keys.Enter)
                {
                    //使按键生效
                    e.Handled = true;
                    //发送按键指令
                    SendKeys.Send("{Tab}");
                }
            }
            #endregion

    使用 KeyChar 属性在运行时对击键取样,在特定运行时环境下修改击键。 例如,您可以使用 KeyChar 在用户输入邮政编码时禁用非数字按键,将数据输入字段中所有的字母按键都改为大写,或监视键盘或其他按键输入设备的特定组合键。

    您可以获取或设置以下键:

    • a-z,A-Z。

    • Ctrl。

    • 标点符号。

    • 键盘顶部和数字键盘上的数字键。

    • Enter。

    您不能获取或设置以下键:

      • Tab 键。

      • Insert 和 Delete。

      • Home。

      • End。

      • Page Up 和 Page Down。

      • F1-F2。

      • Alt。

      • 箭头键。

  • 相关阅读:
    再叙存储设备
    分布式文件系统---测试
    分布式文件系统
    Solr 分布式(复制)配置--成功验证
    搜索服务之离线处理思路
    我为公司做的总体架构,欢迎提建议
    python的面向对象
    python异常处理
    迭代器和生成器
    python函数
  • 原文地址:https://www.cnblogs.com/swtool/p/3840175.html
Copyright © 2011-2022 走看看