tags:

views:

167

answers:

3

I have a vb6 form that I've put an ocx control on. Setting NegotiateMenus on the form displays the ocx's control (which is what I want). I then add my own control to the form. When that control has focus, the menu from the ocx disappears.

How can I always keep the menu from the ocx displayed, regardless of who has focus?

A: 

Sorry, I can't understand. Does the OCX control display a menu inside it's own area, or is it some kind of menu itself?

dguaraglia
A: 

It is just a normal menu. It looks exactly like it would if you were to add a menu to the form manually. When you click on the ocx control, the form's menu changes to be the ocx's menu. When you click on another control, the menubar disappears.

dan gibson
+1  A: 

Dan, I remember trying to do something similar many years ago, and could not achieve it. What I ended up doing was adding a empty top level menu with the same caption as the menu on the OCX control, and having it always be disabled. Then, when the OCX got focus I would hide my disabled menu item, making it look as if clicking on the OCX had enabled the menu item. It saves all the ugly jumping around as menus appear and disappear (obviously, once the OCX lost focus I would show the disabled menu again).

If you still want the menu item enabled, you would have to replicate it exactly in your form, and hide your version of it when the Ocx is active (you would also have to wire all your own events to replicate the functionality available on the OCX.

There is no easier way of doing this at I know of.

Apologies not be being more helpful.

Binary Worrier