[問(wèn)答題] 設(shè)已經(jīng)在菜單編輯器中設(shè)計(jì)了窗體的快捷菜單,某頂級(jí)菜單為a1,且取消其“可見(jiàn)”屬性。運(yùn)行時(shí),哪個(gè)事件過(guò)程可以使快捷菜單的菜單項(xiàng)響應(yīng)鼠標(biāo)左鍵單擊和右健單
[問(wèn)答題] 設(shè)已經(jīng)在菜單編輯器中設(shè)計(jì)了窗體的快捷菜單,某頂級(jí)菜單為a1,且取消其“可見(jiàn)”屬性。運(yùn)行時(shí),哪個(gè)事件過(guò)程可以使快捷菜單的菜單項(xiàng)響應(yīng)鼠標(biāo)左鍵單擊和右健單擊的事件過(guò)程是
A) Private Sub Form_MouseDown(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_MouseDown(ButtonAsInteger,ShiftAsInteger,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
End Sub
D) Private Sub Form_MouseDown(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事件用來(lái)響應(yīng)鼠標(biāo)單擊,其中Button的參數(shù)用來(lái)確認(rèn)鼠標(biāo)按鈕(1:左鍵;2:右鍵),PopupMenu方法用以在指定坐標(biāo)位置顯示彈出式菜單,語(yǔ)法如下:[對(duì)象].PopupMenu菜單名,標(biāo)志,x,y。 其中x,y提供菜單顯示位置,標(biāo)志指定快捷菜單的行為。
詞條內(nèi)容僅供參考,如果您需要解決具體問(wèn)題
(尤其在法律、醫(yī)學(xué)等領(lǐng)域),建議您咨詢相關(guān)領(lǐng)域?qū)I(yè)人士。