代码及注释如下:Private Sub Form_KeyPress(KeyAscii As Integer)'在form上敲回车触发事件If KeyAscii = 13 Then'如果按下的是回车键,注意回车Asc码是13Call Command1_Click'那么执行command1点击事件End IfEnd Sub