mshtml & webbrowser VB.NET

G

Guest

Hi
I've this problem
Inside a winform application I've put a "webbrowser" control
I've tried to catch the oncontextmenu event of the loaded HTML document with the following

approach

1) In the event handler AxWebBrowser1.DocumentComplete I've put:

Dim doc As mshtml.HTMLDocument
doc = AxWebBrowser1.Document
AddHandler CType(doc, mshtml.HTMLDocumentEvents2_Event).oncontextmenu, _
AddressOf Document_contextmenu

2) In the event handler BeforeNavigate2 of the webbrowser control I've put:

Dim doc As mshtml.HTMLDocument
doc = AxWebBrowser1.Document
RemoveHandler CType(doc, _
mshtml.HTMLDocumentEvents2_Event).oncontextmenu, _
AddressOf Document_contextmenu

3) I've written an event handler Document_contextmenu like this

Private Function Document_contextmenu(ByVal e As mshtml.IHTMLEventObj) As _
Boolean
Return False
End Function

PROBLEM: The contextual menu is disabled (as I want!), but every other events over the html

elements in the page are also disabled (links, buttons, text box and so on
Why ???
Thanks in advanc
giuseppe

PS: I've read the document Microsoft 311284

(http://support.microsoft.com/?kbid=311284):bowdown
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top