将窗体的KeyPreview属性设为True,然后编写如下程序: Private Sub Form_KeyDown(KeyCode As Integer,Shift As Integer) Print Chr(KeyCode) End Su

admin2019-08-22  23

问题 将窗体的KeyPreview属性设为True,然后编写如下程序:
  Private Sub Form_KeyDown(KeyCode As Integer,Shift As Integer)
  Print Chr(KeyCode)
    End Sub
    Private Sub Form_KeyPress(KeyAscii As Integer)
    Print Chr(KeyAscii)
    End Sub
  运行程序时,按下字母键a,则窗体上显示的是(    )。

选项 A、A A
B、A a
C、a A
D、a a

答案B

解析 KeyCode是按键的实际字符(不区分大小写),KeyAscii是以字符为准,是所按键的ASCⅡ码。
转载请注明原文地址:https://kaotiyun.com/show/GoTp777K
0

相关试题推荐
随机试题
最新回复(0)