Hello, I use subroutine Utility("CREATE",MenuStruct) to make a context menu. But as far as i understand, this menu is created when the form generates the "create" event. But I need to make 2 types of context menus in one form for different names of controls. Could you tell me what to do for it? Thanks a lot.
Irina,
Have you already looked at the Knowledge Base article on Creating Context Menus?
What version of OI are you using? OI 7.x now has a Context Menu builder.
Of course, I've used this topic. But I don't understand how to make two types of menus using this event handler. The problem is how to create two types of menus when the form is creating and how to execute one or another for different controls.
Irina,
My response is a bit over-simplified because there are a variety of little issues that are involved with this. However, instead of using the CREATE event you will want to capture the right-click of a mouse and create your context menu on-the-fly (as it were) for the control that the mouse is floating over. This involves using the WINMSG event and qualifying the appropriate Windows Message. There have been threads posted on this site that detail how to do this as well as another Knowledge Base article called Catching a Right Mouse Click, and other Windows Messages.
Bottom line, you need to take the basic elements of what has already been documented and adapt them to your situation. The original context menu article is admittedly too simple. However, it does give you the mechanics for creating the context menu. So, instead of doing it in the CREATE event of a window just put this code in the WINMSG event and you will be well on your way.