问题
单项选择题
在窗体上画—个名称为Text1的文本框,并编写如下程序: Private Sub Form_Load()ShowText1.Text=" "Text1.SetFocus End Sub Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single,Y As Single)Print "程序设计" End Sub Private Sub Text1_KeyDown(KeyCode As Integer,Shift As Integer)Print "Visual Basic"; End Sub 程序运行后,如果按A键,然后单击窗体,则窗体上显示的内容是 ______。
A.Visual Basic
B.程序设计
C.A程序设计
D.Visual Basic程序设计
答案
参考答案:D
解析:[评析] 因为程序一运行,文本框Text1获得焦点,按下A键后,执行Text1_KeyDown事件,在窗体上显示“Visual Basic”;这时再单击窗体,则触发Form MouseUp事件,在窗体上显示“程序设计”。