I am hosting a web browser ctl in a container that implements the
IDocHostUIHandl er interface. I'm using this to control the context menu.This
works fine.
Then, I added a mouseover event to the document in the documentComplet e
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_D ocumentComplete (object sender,
AxSHDocVw.DWebB rowserEvents2_D ocumentComplete Event e)
{
mshtml.HTMLDocu ment doc = (mshtml.HTMLDoc ument)axWebBrow ser1.Document;
mshtml.HTMLDocu mentEvents2_Eve nt docEvents =
(mshtml.HTMLDoc umentEvents2_Ev ent) doc;
docEvents.onmou seover+=new
HTMLDocumentEve nts2_onmouseove rEventHandler(d ocEvents_onmous eover);
}
private void docEvents_onmou seover(IHTMLEve ntObj e)
{
if (e.srcElement.G etType() == typeof(mshtml.H TMLAnchorElemen tClass))
{
mouseoverTextBo x.Text = e.srcElement.Ge tType().ToStrin g() + " " +
e.srcElement.ou terHTML;
}
e.cancelBubble = false;
e.returnValue = false;
}