设有窗体的Form MouseMove事件过程如下: Private Sub Form_MouseMove(Button As Integer,Shift As Integer,X As Single,Y As Single) If(Button And

admin2017-06-21  24

问题 设有窗体的Form MouseMove事件过程如下:
Private Sub Form_MouseMove(Button As Integer,Shift As Integer,X As Single,Y As Single)
If(Button And 3)=3 Then
   Print"检查按键"
End If  
End Sub
关于上述过程,以下叙述中正确的是

选项 A、按下鼠标左键时,在窗体上显示“检查按键”
B、按下鼠标右键时,在窗体上显示“检查按键”
C、同时按下鼠标左、右键时,在窗体上显示“检查按键”
D、不论做何种操作,窗体上都不会显示

答案C

解析 鼠标事件的Button参数用以表示被按下的鼠标键,可以取3个值,按下左键取值为1,按下右键取值为2,按下中键取值为4,若同时按下多个键,则取值为多个键值之和。
转载请注明原文地址:https://jikaoti.com/ti/7ny0FFFM
0

最新回复(0)