且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

添加自定义弹出菜单以形成快捷菜单

更新时间:2023-11-14 15:44:52

您好,


您的意思是要将自定义弹出菜单添加到指定的表单吗?您可以将表单的快捷菜单属性设置为是,并将快捷菜单栏设置为菜单名称。


您也可以通过VBA代码。

私有Sub Form_Load()
Form.ShortcutMenu = True
Form.ShortcutMenuBar =" CustomPopupMenu"
End Sub

***的问候,


Celeste



So at the start of my database I create a popup menu and add it to the Menu Bar so it is saved throughout the duration of the application. I have this as a custom menu item which I have been using no problem but I recently decided to also add it to the shortcut menu of the main form and I cant see how this is done without creating the same menu and all its controls from scratch again for the shortcut menu. Is there a way to reuse an already existing menu popup as an item on a shortcut menu?

Thanks

Hello,

Do you mean you want to add the custom popup menu to a specified form? You could set the form's Shortcut Menu property to Yes and set Shortcut Menu Bar as your Menu name.

You also do it via VBA code.

Private Sub Form_Load()
Form.ShortcutMenu = True
Form.ShortcutMenuBar = "CustomPopupMenu"
End Sub

Best Regards,

Celeste