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
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