在窗体上画一个名称为Text1的文本框,然后编写以下事件过程:Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If _________________ Then Text1.SelStart = 0 Text1.SelLength = Len(Text1.Text) End IfEnd Sub要求程序运行时,若输入焦点在Text1上,按下组合键Ctrl+A可以选取Text1内所有的文本,则在横线处应填入的表达式是________。
A: KeyCode = 65 And Shift = 2
B: Text1.KeyCode = "A" And Text1.Shift = "Ctrl"
C: KeyCode = "A" And Shift = "Ctrl"
D: Text1.KeyCode = 65 And Text1.Shift = 2
A: KeyCode = 65 And Shift = 2
B: Text1.KeyCode = "A" And Text1.Shift = "Ctrl"
C: KeyCode = "A" And Shift = "Ctrl"
D: Text1.KeyCode = 65 And Text1.Shift = 2
举一反三
- 在窗体上画一个名称为Text1的文本框,然后编写以下事件过程:Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If _________________ Then Text1.SelStart = 0 Text1.SelLength = Len(Text1.Text) End IfEnd Sub要求程序运行时,若输入焦点在Text1上,按下组合键Ctrl+A可以选取Text1内所有的文本,则在横线处应填入的表达式是________。 A: KeyCode = "A" And Shift = "Ctrl" B: KeyCode = 65 And Shift = 2 C: Text1.KeyCode = 65 And Text1.Shift = 2 D: Text1.KeyCode = "A" And Text1.Shift = "Ctrl"
- 下列程序执行后,按住<Ctrl>键,并在文本框中输入“a”,则在窗体上输出结果为( )。 Private Sub Text1_KeyDown(KeyCode As Integer,Shift As Integer) Print KeyCode,Shift End Sub A: a 2 B: 65 2 C: 97 1 D: 97 2
- 在窗体上画 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
- 窗体上有文本框Text1,编写如下事件过程,运行时,向文本框输入字符“y”,输出的数值是( )。 Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) Print KeyCode End Sub
- 窗体上有1个名称为Text1、内容为空的文本框。编写如下事件过程: Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer) Print Text1. Text; End Sub 运行程序,并在文本框中输入“123”,则在窗体上的输出结果为( )。 A: A) 123 B: B) 112 C: C) 12123 D) 112123