M
Mitch
I am hosting a web browser ctl in a container that implements the
IDocHostUIHandler interface. I'm using this to control the context menu.This
works fine.
Then, I added a mouseover event to the document in the documentComplete
event handler.
When I add this event handler, I loose all other navigation functions in the
browser! right click, left click, it's all dead. (The mouseover works
though)
Does anyone know ow do I get a mouseover working?
Thanks. (I posted this a few weeks ago, but I'm still having problems. Any
help is appreciated)
Mitch
Below is the code for hooking up the event handler, followed by the event
handler itself (using c# and .Net 1.1):
private void axWebBrowser1_DocumentComplete(object sender,
AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent e)
{
mshtml.HTMLDocument doc = (mshtml.HTMLDocument)axWebBrowser1.Document;
mshtml.HTMLDocumentEvents2_Event docEvents =
(mshtml.HTMLDocumentEvents2_Event) doc;
docEvents.onmouseover+=new
HTMLDocumentEvents2_onmouseoverEventHandler(docEvents_onmouseover);
}
private void docEvents_onmouseover(IHTMLEventObj e)
{
if (e.srcElement.GetType() == typeof(mshtml.HTMLAnchorElementClass))
{
mouseoverTextBox.Text = e.srcElement.GetType().ToString() + " " +
e.srcElement.outerHTML;
}
e.cancelBubble = false;
e.returnValue = false;
}
IDocHostUIHandler interface. I'm using this to control the context menu.This
works fine.
Then, I added a mouseover event to the document in the documentComplete
event handler.
When I add this event handler, I loose all other navigation functions in the
browser! right click, left click, it's all dead. (The mouseover works
though)
Does anyone know ow do I get a mouseover working?
Thanks. (I posted this a few weeks ago, but I'm still having problems. Any
help is appreciated)
Mitch
Below is the code for hooking up the event handler, followed by the event
handler itself (using c# and .Net 1.1):
private void axWebBrowser1_DocumentComplete(object sender,
AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent e)
{
mshtml.HTMLDocument doc = (mshtml.HTMLDocument)axWebBrowser1.Document;
mshtml.HTMLDocumentEvents2_Event docEvents =
(mshtml.HTMLDocumentEvents2_Event) doc;
docEvents.onmouseover+=new
HTMLDocumentEvents2_onmouseoverEventHandler(docEvents_onmouseover);
}
private void docEvents_onmouseover(IHTMLEventObj e)
{
if (e.srcElement.GetType() == typeof(mshtml.HTMLAnchorElementClass))
{
mouseoverTextBox.Text = e.srcElement.GetType().ToString() + " " +
e.srcElement.outerHTML;
}
e.cancelBubble = false;
e.returnValue = false;
}