在窗体上画一个命令按钮Command1和两个文本框,名称分别为Text1和Text2。编写如下两个事件过程:
Dim Str1 As String, str2 As String
Private Sub form_load()
Text1.Text=“”
Text2.Text=“”
Text1.Enabled=False
Text2.Enabled=False
End Sub
Private Sub Form_KeyPress(KeyAsai As Integer)
str1=str1&Chr(KeyAscii)
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
str2=str2&Chr(KeyCodel
End Sub
Private Sub Command1_Clickt)
Text1.Text=str1
Text2.Text=str2
str1=“”
str2:“”
End Sub
当在设计阶段的窗体的KeyPreview属性设置为True时,程序运行过程中,在键盘上输入小写字母abc,然后单击命令按钮,则文本框Text1中显示的内容为( )。
A) abc
B)不显示任何信息
C) ABC
D)出错