473,545 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mouseover event in axWebbrowser kills navigation functions

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;
}
Nov 16 '05 #1
2 5162

You have to implement IHTMLEditDesign er Interface and trap mousemoves in
PreHandleEvent
//get the service provider interface
IServiceProvide r htmlServiceProv ider =
(IServiceProvid er)browser.Docu ment;

object oEditServices;
uint hResult = htmlServiceProv ider.QueryServi ce ( ref
Guids.SID_SHTML EditServices, ref Guids.IID_IHTML EditServices, out
oEditServices );
mshtml.IHTMLEdi tServices pEditServices =
(mshtml.IHTMLEd itServices)oEdi tServices;

/// Add this control as a designer of the html document so we can handle
all the events.
pEditServices.A ddDesigner (pEditDesigner) ;

--
Shak
(Houston)
"Mitch" <xx***@avantium .com> wrote in message
news:uV******** ******@TK2MSFTN GP12.phx.gbl...
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;
}

Nov 16 '05 #2
Thanks. I'll give that a try. It seems a bit complex though just to catch am
ouseover event.
Just curious, do you have any insight as to why just catching the events off
the document
doesn't work? why are those event even there?

Mitch

"Shakir Hussain" <sh**@fakedomai n.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..

You have to implement IHTMLEditDesign er Interface and trap mousemoves in
PreHandleEvent
//get the service provider interface
IServiceProvide r htmlServiceProv ider =
(IServiceProvid er)browser.Docu ment;

object oEditServices;
uint hResult = htmlServiceProv ider.QueryServi ce ( ref
Guids.SID_SHTML EditServices, ref Guids.IID_IHTML EditServices, out
oEditServices );
mshtml.IHTMLEdi tServices pEditServices =
(mshtml.IHTMLEd itServices)oEdi tServices;

/// Add this control as a designer of the html document so we can handle all the events.
pEditServices.A ddDesigner (pEditDesigner) ;

--
Shak
(Houston)
"Mitch" <xx***@avantium .com> wrote in message
news:uV******** ******@TK2MSFTN GP12.phx.gbl...
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;
}


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2286
by: Colin Steadman | last post by:
Help! I'm a stupid HTML bod and I dont do Javascript! I have a grey coloured table that displays certain columns in either red, green or orange to give meaning and emphasis to certain data. What I want to do now is setup some kind of javascript event so that when the user mouse's over a row the row changes colour to highlight it. I've...
14
2323
by: J. Makela | last post by:
Hallo. This should be a pretty entertaining question for you *real* javascript writers.. I, being the lowly photoshop guy at an ad agency made the mistake of actually saying "HTML" in a conversation once.. and now I have been tasked with building a big website with LOTS of fancy javascripting. Image rollovers mostly. Only problem is that I...
9
7953
by: Kim | last post by:
Hi I'm trying to do something like this. for(i=0; i<5; i++){ var theData = document.createElement('a'); theData.onmouseover = function() { return get(i);} ... ... }
2
3334
by: Alex | last post by:
On my page I have a lot string like this: <span onmouseover="callMe(this)" onmouseout="callMe(null)" >abc1</span> <span onmouseover="callMe(this)" onmouseout="callMe(null)" >abc2</span> <span onmouseover="callMe(this)" onmouseout="callMe(null)" >abc3</span> <span onmouseover="callMe(this)" onmouseout="callMe(null)" >abc4</span> How can I...
1
1377
by: SPG | last post by:
Hi, I have an app that requires several of the web controls to be shown in an MDI form. In most cases I can show these forms and point them all to different URLS fine. Every now and then, and without any specific number of forms open, the control will start navigating but never return.
2
400
by: Casey | last post by:
Greetings, I have an ASP .NET page that contains three images which give the appearance of a tabbed folder. The images contain the words Product Search, Cart, and Summary respectively. The idea is that when the user is on the Product Search page, an image is displayed to give the appearance that the tab is selected. The user can mouse...
3
19492
by: Annette Acquaire | last post by:
I have and image map with a dozen hotspot links on it that I'm trying to get to open a new image over existing one on mouseover of each COORD. The only thing I was able to do was swap image on mouseover entire image, I want it on each hotspot only, so an image pertaining to each link shows up. I have done it in JavaScript, but the website I'm...
1
2719
by: Christian Sengstock | last post by:
Hi all, i have a js application with several event handlers which i manage via prototype .bindAsEventListener. On normal page navigation ( link navigation ) i finish all events handlers (onUnload) if a new page should be loaded and everything works fine: All event handlers are finished and the new page works fine. However, if i do a...
2
3004
by: markszlazak | last post by:
I'm a relatively slow response of table cells changing their background color with mouseover/our in IE6 (Win 2K) but the response is fine (fast) in Firefox. Why? The code is below. Sorry about the length. <html> <head> <title>Rapid Blocking Interface</title> <style> .calendar {
0
7484
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7928
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7440
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5344
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4963
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3470
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3451
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1902
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1030
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.