我有一个带有按钮的表单,当我单击 TAB 键时,按钮被选中,但是当我单击 ENTER 键时,此代码未执行。我的代码是,
Private Sub Button1_Keypress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Button1.KeyPress
If Asc(e.KeyChar) = 13 Then
MsgBox("DO SOMETHING")
End If
End Sub