[单项选择题] 对窗体编写如下事件过程: Private Sub Form_ Mouse Down(Button As Integer,Shift As Integer,X AS Single,Y

21 查阅

[单项选择题] 对窗体编写如下事件过程:

Private Sub Form_ Mouse Down(Button As Integer,Shift As Integer,X AS Single,Y As Single)

If Button=2 Then

Print "AAAAA"

End if

End Sub

Private Sub Form _ MouseUp(Button As Integer,Shift As Integer,X As Single,Y As Single)

Print "BBBBB"

End Sub

程序运行后,如果单击鼠标右键,则输出结果为 ______。

A.AAAAA

BBBBB

B.BBBBB

AAAAA

C.AAAAA

D.BBBBB

参考答案:

A

在窗体上单击鼠标右键时,实际上先后触发了两个事件,即先触发MouseDown事件,执行Print方法输出AAAAA;当释放鼠标键时,触发MouseUp事件,再次执行Print方法,输出BBBBB。其实在Visual Basic中类似的还有DblCtick事件,也是先后触发了两个事件,即当双击鼠标时,先触发Click事件,再触发 DblClick事件。

计算机考试