Dim strKeys As String'所有被按下的键值
Private Sub Form2_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress
Dim strNowKey As String = e.KeyChar '获取当前被按下的键值
strKeys = strKeys & strNowKey
End Sub
Private Sub Form2_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp
MessageBox.Show(strKeys)
strKeys = Nothing
End Sub