编写如下窗体事件过程: Private Sub Form_MouseDown( Button As Integer ,Shift As Int.eger,X As Single,Y As Single) If Shift =6 And

admin2020-06-25  20

问题 编写如下窗体事件过程:
    Private Sub Form_MouseDown( Button As Integer ,Shift As Int.eger,X As Single,Y As Single)
      If Shift =6 And Button =2 Then
             MsgBox " Hello"
      End If
End Sub
程序运行后,为了在窗体上消息框中输出“Hello”信息,在窗体上应执行的操作是(    )。

选项 A、同时按下Shift键和鼠标左键
B、同时按下Shift键和鼠标右键
C、同时按下Ctrl、Alt键和鼠标左键
D、同时按下Ctrl、Alt键和鼠标右键

答案D

解析 在窗体的鼠标事件中,参数Button的值为1表示左键按下,值为2表示右键按下,值为4表示中间按键按下,参数Shift的值为1表示Shift键按下,值为2表示Ctrl键按下,值为4表示Alt键按下。Shift值为6则说明是Ctrl键和Alt键按下,Button值为2说明是鼠标右键按下。
转载请注明原文地址:https://kaotiyun.com/show/K1cp777K
0

相关试题推荐
最新回复(0)