编写如下程序: Private Sub Form_Click()   Print "Welcome!" End Sub Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As

admin2020-07-22  31

问题 编写如下程序:
Private Sub Form_Click()
  Print "Welcome!"
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  Print "欢迎!"
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  Print "热烈欢迎!"
End Sub
程序运行后,单击窗体,输出结果为(  )。

选项 A、欢迎!
热烈欢迎!
Welcome!
B、欢迎!
Welcome!
热烈欢迎!
C、Welcome!
欢迎!
热烈欢迎!
D、 Welcome!
热烈欢迎!
欢迎!

答案A

解析 在窗体事件中,鼠标按键按下激发MouseDown事件,鼠标按钮松开激发MouseUp事件,鼠标按下并松开后激发Click事件,所以这三个事件的顺序是MouseDown、MouseUp、Click,因此输出文字的顺序是"欢迎!"、"热烈欢迎!"、"Welcome!"。
转载请注明原文地址:https://kaotiyun.com/show/DRHp777K
0

最新回复(0)