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

admin2013-10-17  21

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

选项 A、Private Sub Form MouseDown(Button As Integer,_
    ShiftAs Integer,XAs Single,YAs Single)
    IfButton=2 Then PopupMenu al,2
End Sub
B、Private Sub Form_MouseDown(ButtonAs Integer,_
    ShiftAs Integer,XAs Single,YAs Single)
    PopupMenu a1,0
End Sub
C、Private Sub Form_MouseDown(ButtonAs Integer,_
    ShiftAs Integer,XAs Single,YAs Single)
    PopupMenual
End Sub
D、Private Sub Form_MouseDown(ButtonAs Integer,ShiftAs_
    Integer,X As Single,Y As Single)
    If(Button=vbLetfButton)Or(Button=vbRightButton)Then PopupMenu al
End Sub

答案A

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

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