窗体的事件过程如下: Private Sub主体_MouseDown(Button AsInteger,Shift As Integer,X As Single,Y As Single) If Shift=6 And Button=2 Th

admin2019-04-13  27

问题 窗体的事件过程如下:
    Private Sub主体_MouseDown(Button AsInteger,Shift As Integer,X As Single,Y As Single)
    If Shift=6 And Button=2 Then
    MsgBox”Hello World.”
    End If
    End Sub
程序运行后,要在窗体消息框中显示“Hello world.”,在窗体上应执行的操作是(    )。

选项 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/OU0p777K
0

最新回复(0)