0
votes

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?

1

1 Answers

1
votes

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.