问题 单项选择题

设已经在菜单编辑器中设计了窗体的快捷菜单,某顶级菜单为a1,且取消其"可见"属性。运行时,可以使快捷菜单的菜单项响应鼠标左键单击和右健单击的事件过程是______。

A) Private Sub Form_Mouse Down(Button As Integer,Shift As Integer,_X As Single,
Y As Single)
If Button=2 Then PopupMenu a1,2
End Sub
B) Private Sub Form_Mouse Down(Button As Integer,Shift As Integer,_X As Single,
Y As Single)
PopupMenu a1,0
End Sub
C) Private Sub Form_Mouse Down(Button As Integer,Shift As Integer,_X As Single,
Y As Single)
PopupMenu a1,2
End Sub
D) Private Sub Form_Mouse Down(Button As Integer,Shift As Integer,_X As Single,
Y As Single)
If(Button=vbLetfButton) Or(Button=vbRightButton) Then PopupMenu a1
End Sub

答案

参考答案:C

解析: MouseDown事件用来响应鼠标单击,其中Button的参数用来确认鼠标按钮(1:左键;2:右键),Popup-Menu方法用以在指定坐标位置显示弹出菜单,语法如下:[对象].PopupMenu菜单名,标志,x,y。其中x,y提供菜单显示位置;标志:指定快捷菜单的行为。

单项选择题
单项选择题 A型题