Using ContextMenus with AxHost'ed ActiveX Controls
I am upgrading from VB6 to VB.NET.
I place a third-party ActiveX control on a VB.NET form.
I cannot set a ContextMenu for the control because AxHost does not support it. (I can set the property in the start-up code but nothing happens when I right-click.)
Instead, I handle the MouseDownEvent for the control and call myContextMenu.Show(controlname, point).
The context menu pops up as expected.
When I move the mouse up and down the list of items on the menu, I get myContextMenu.Select events.
When I click on a menu item, however, I do not get a myContextMenu.Click event.
This technique works fine for .NET controls.
Can anyone help?
[669 byte] By [
grover2] at [2007-12-17]
Isn't this a coincidence?
I'm having the same problem too.... all day as a matter of fact.
I'm working with the DHTMLEdit control. I'll let you know what I find out.
I just got mine working !!!!!
My Control is the DHTML control and it has a document with it own events.....
These events were conflicting with the context menu event.
There are two ways to go about debugging this.
Method 1.) Make a new project with nothing in it an migrate the bare bones functionality into and demonstrate that menu works...
This worked for me and I saw the context menu....
Method 2.) Usually better when # 1 is done before hand.
Comment out the Handle clause on ALL event handlers except the context menu event handler Until you see the context menu
Then One by one.... remove the comments on the handles...until you the context menu appears....
This worked for me after I'd struggled with it all day....