C#按Enter键触发按钮点击事件

海贝贝   2024年4月14日 浏览量:599

private void richTextBox2_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
               // button2.Focus();
                button1_Click(sender, e);
            }
            if (e.KeyChar == System.Convert.ToChar(13))
            {
                e.Handled = true;
            }
        }

加载中...

正在加载更多内容...

更新日期:2024年4月14日
关键字:C#按Enter键触发按钮点击事件
免责声明:文章或资料来源于网络,如有关于本文内容、版权或其它问题请于文章发表后的30日内与本网管理员联系删除或修改。

01/1|<<1>>|
关键字相关信息