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

admin2018-10-18  17

问题 编写如下程序:
    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

解析 鼠标事件分点击事件和状态事件:其中,点击事件有单击事件(Click)和双击事件(DblClick),这两个事件不区分左键和右键;状态事件又分为按下事件(MouseDown)、移动事件(MouseMove)和弹起事件(MouseUp),这3个事件能够区分出鼠标的左键、右键和中间键。当在控件和窗体上单击鼠标左键的时候,首先触发按下事件,然后触发单击事件,最后触发弹起事件。
转载请注明原文地址:https://kaotiyun.com/show/aDFp777K
0

最新回复(0)