473,734 Members | 2,798 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 5174

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
2299
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 discovered however that I can only change the row into one specific colour, and then back again into...
14
2362
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 don't really know how to do it. Of course, that's of no consequence so I have to do it anyway....
9
8007
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
3351
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 optimize it? Is it possible to move this definition what to do to style/css or some other common...
1
1383
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 over the other images and with roll over effects, those tabs appear selected as well for the user...
3
19498
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 using doesn't use JavaScript. Y'all are obviously light-years more knowledgeable then me on html...
1
2744
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 browser "reload" the events a fired twice after it.
2
3031
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
9310
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6031
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
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
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.