将窗体的KeyPreview 属性设置为True ,然后编写如下事件过程: Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Print Chr(KeyCode); End Sub Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) Print Chr(KeyCode + 32); End Sub 在行前先,按下Caps Lock键使 Caps Lock指示灯亮。行后按“A”键,则输出的结果为 A. aA B. AA C. Aa D. AB