己知在菜单编辑器中设计了窗体的快捷菜单,其主菜单为a1,且取消其“可见”属性,如图2所示。运行时,以下( )事件过程可以使快捷菜单的菜单项响应鼠标右键单击。

admin2018-07-11  28

问题 己知在菜单编辑器中设计了窗体的快捷菜单,其主菜单为a1,且取消其“可见”属性,如图2所示。运行时,以下(   )事件过程可以使快捷菜单的菜单项响应鼠标右键单击。

选项 A、Private Sub Form MouseDown(Button As Integer,
ShiftAs Integer,XAs Single,YAs Single)
IfButton=2 Then PopupMenu a1.2
End Sub
B、Private Sub Form MouseDown(ButtonAs Integer,
ShiftAs Integer,X As Single,YAs Single)
PopupMcnu al,0
End Sub
C、Private Sub Form MouseDown(Button As Integer,
Shift As Integer,X As Single,YAs Single)
PopupMenu al
End Sub
D、Private Sub Form_MouseDown(Button As Integer,ShiftAs
Integer,X As Single,YAs Single)
If(BuRon=vbt,etfButton)Or(Button=vbRightButton)ThenPopupMenu a1
End Sub

答案A

解析 本题考查弹出菜单的显示。PopupMenu为弹出菜单方法,其中,标志表示弹出的位置和触发的键,取值为0表示弹出菜单的左端在x处且识别左键单击,取值为04表示位于x的中心,取值为08表示在x的右边,一般判断是否单击右键,可通过判断Button是否为2来实现。
转载请注明原文地址:https://kaotiyun.com/show/mzFp777K
0

最新回复(0)