窗体的事件过程如下:
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.”,在窗体上应执行的操作是( )。
【正确答案】 D
【答案解析】在窗体的鼠标事件中,参数Button的值为1表示左键按下,值为2表示右键按下,值为4表示中间按键按下;参数Shift的值为1表示Shift键按下,值为2表示Ctrl键按下,值为4表示Alt键按下。Shift值为6说明是Ctrl键和Alt键同时按下,Button值为2说明是鼠标右键按下。