单选题

在窗体上画一个命令按钮和两个文本框,其名称分别为Commandl、Textl和Text2,在属性窗口中把窗体的KeyPreview属性设置为True,然后编写如下程序:
Dim S1 As String, S2 As String
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text1.Enabled = False
Text2.Enabled = False
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
S2 = S2 & Chr(KeyCode)
Print S2
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
S1 = S1 & Chr(KeyAscii)
Print S1
End Sub
Private Sub Command1_Click()
Text1.Text = S1
Text2.Text = S2
S1 = ""
S2 = ""
End Sub
程序运行后,先后按“a”、“b”、“c”键,然后单击命令按钮,在文本框Textl和Text2中显示的内容分别为(    )。

发布于 2022-05-11 10:17:59

登录后免费查看答案
关注者
0
被浏览
17
知识点
面圈网VIP题库

面圈网VIP题库全新上线,海量真题题库资源。 90大类考试,超10万份考试真题开放下载啦

去下载看看