I ahve a windowsform app with an embedded web browser. I let VS create a
wrapper called AxWebBrowser. The "BeforeNavigate2" event handler
fires as expected, unitl I also add a handler to the "onclick"
event that is part of the mshtml.HTMLDocumentEvent2 object. In addition
when I add the "onclick" event handler, the browser looses all
ability to navigate. i.e. clicking a link does nothing, no events
raised, no navigating to the link url.
If tried different return values in the "onclick" event handler,
but the results are always the same. I've seen older posts with
this same problem, but no one seems to have figured it out.
Any ideas? Thanks.
Mitch
Here's the code where I wire up the event handlers:
this.axWebBrowser1.BeforeNavigate2 += new
AxSHDocVw.DWebBrowserEvents2_BeforeNavigate2EventH andler
(this.axWebBrowser1_BeforeNavigate2);
//This goes on the Download complete handler:
mshtml.HTMLDocument doc = (mshtml.HTMLDocument)axWebBrowser1.Document;
mshtml.HTMLDocumentEvents2_Event iEvent =
(mshtml.HTMLDocumentEvents2_Event) doc;
iEvent.onclick += new
mshtml.HTMLDocumentEvents2_onclickEventHandler(iEv ent_onclick);