对窗体编写如下事件过程: Private Sub Form_ Mouse Down(Button As Integer,Shift As Integer,X AS Single,Y As Single) If Button=2 Then

admin2009-03-15  24

问题 对窗体编写如下事件过程:    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

答案1

解析 在窗体上单击鼠标右键时,实际上先后触发了两个事件,即先触发MouseDown事件,执行Print方法输出AAAAA;当释放鼠标键时,触发MouseUp事件,再次执行Print方法,输出BBBBB。其实在Visual Basic中类似的还有DblCtick事件,也是先后触发了两个事件,即当双击鼠标时,先触发Click事件,再触发 DblClick事件。
转载请注明原文地址:https://kaotiyun.com/show/WJ1p777K
0

最新回复(0)