Page 1 of 1

Adding Menu Item to Setup Menu

Posted: Wed Jul 31, 2013 8:05 am
by drtech
Can someone give me some instruction on the proper way to add a menu item with click event to the Setup Menu of OD with a plugin? All I want is to launch my setup window from an item on the setup menu, but I can't seem to figure out how to add a menu item dynamically with it's own click event. I have added many controls to other forms with my plugin using the example code in the sample project, but I am not very familiar with menus and can't seem to figure it out.

Help anyone?

Re: Adding Menu Item to Setup Menu

Posted: Wed Jul 31, 2013 9:33 am
by jsalmon
It's been a very long time since I've done plugins so I don't remember quite what you have access to but if I wanted to dynamically add to Setup I would do the following:

Code: Select all

menuItemSettings.MenuItems.Add("Click Me",new System.EventHandler(this.menuItemClickMe_OnClick));
My guess is that you would do this in the Plugins.HookAddCode(this,"FormOpenDental.Load_end"); call. This is assuming you have access to menuItemSettings (which is the Setup menu item)

Hope that helps.