在窗体上画 1 个文本框,其名称为 Text1,然后编写如下过程: Private Sub Text1_KeyDown(KeyCode As Integer,Shift As Integer) Print Chr(KeyCode)End SubPrivate Sub Text1_KeyUp(KeyCode As Integer,Shift As Integer) Print Chr(KeyCode+2)End Sub 程序运行后,把焦点移到文本框中,此时如果敲击"A"键,则输出结果为______。
A: A
B: A
C: A
D: A
A: A
B: A
C: A
D: A
举一反三
- 在窗体上画1个文本框,其名称为Text1,然后编写如下过程:Pfivme Sub Text1_KeyDown(KeyCode As Integer,Shift As Integer)Print Chr(KeyCode)End SubPrivate Sub Text1_KeyUp(KeyCode As Integer,Shift As Integer)Print Chr(KeyCode+2)End Sub程序运行后,把焦点移到文本框中,此时如果敲击“A”键,则输出结果为()。 A: A A B: A B C: A C D: A D
- 在窗体上画一个文本框,其名称为Text1,然后编写如下过程: Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) Print Chr(KeyCode) End Sub Private Sub Text1_KeyUp(KeyCode As Integer, Shift As integer) Print Chr(KeyCode+2) End Sub 程序运行后,把焦点移到文本框中,此时如果敲击“A”键,则输出结果为 A: A B: A C: A D: B E: A F: C G: A H: D
- 将窗体的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+2) End Sub 程序运行后,如果按“A”键,则输出的结果为 A.A A B.A B C.A C D.A D
- 窗体KeyUp事件过程如下,启动程序后按小写字母“a”,输出结果为______。 Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) Print Chr(KeyCode) End Sub
- 窗体上有文本框Text1,编写如下事件过程,运行时,向文本框输入字符“y”,输出的数值是( )。 Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) Print KeyCode End Sub