在事件private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)里面:
#region
if ((e.KeyChar==10))
    {
        MessageBox.Show("Enter OK");
        button1_Click(null,EventArgs.Empty);
    }
#endregion
在textBox1_KeyPress 触发button1_Click事件.

或者下面代码
  protected override bool ProcessDialogKey(Keys keyData)
        {
            
//if   (keyData   ==(Keys.Control || Keys.Return)) 
            if   (keyData   ==(Keys.Control  |   Keys.A)) 
            {
                fullScreenBtn_Click(
null, EventArgs.Empty); 
            }

            
if (keyData == (Keys.Control | Keys.B))
            {
                mouseCaptureBtn_Click(
null, EventArgs.Empty);
            }

            
if (keyData == (Keys.Control | Keys.C))
            {
                ClearBtn_Click(
null, EventArgs.Empty);
            }


            
return base.ProcessDialogKey(keyData); 
        }

相关文章:

  • 2021-08-19
  • 2022-12-23
  • 2022-12-23
  • 2021-10-18
  • 2021-08-26
  • 2022-12-23
  • 2021-05-20
猜你喜欢
  • 2022-12-23
  • 2021-11-22
  • 2021-09-03
  • 2021-11-03
  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案