本帖最后由 15942617904 于 2020-10-24 09:42 编辑
项目需要右键spread出一个快捷菜单,我是按照葡萄城给的下面的代码实装的
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim custommenu As New ContextMenu
custommenu.MenuItems.Add("&Table")
custommenu.MenuItems.Add("&Color", New EventHandler(AddressOf ContextMenu_Color))
FpSpread1.ContextMenu = custommenu
End Sub
Private Sub ContextMenu_Color(ByVal sender AsObject, ByVal e As System.EventArgs)
MsgBox("You chose color.")
End Sub 请问怎么在菜单中添加快捷键,例如,右键后菜单出来了,不用鼠标点击Color而是按C键同样去执行点击Color的处理
|