[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to add event handler to IDocument2.onclick  using C#?

Posted on 2003-11-06
3
Medium Priority
?
585 Views
Last Modified: 2008-03-04
How to add event handler to IDocument2.onclick  using C# if I have and oject of mshtml.IDocument2 ?
0
Comment
Question by:AlexanderShkabarnya
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
purpleblob earned 760 total points
ID: 9695614
Assuming you've got mshtml reference etc.

((mshtml.HTMLDocumentEvents2_Event)html2).onclick += new mshtml.HTMLDocumentEvents2_onclickEventHandler(this.HTML_onclick);

And

private bool HTML_onclick(mshtml.IHTMLEventObj e)
{
   MessageBox.Show("OnClick");
   return true;
}

Note: I've prefixed mshtml to everything but if your're using mshtml; then you will not need this :-)

As per your other question ;-) I assume when you say IDocument2 you mean IHTMLDocument2 ?
0
 

Author Comment

by:AlexanderShkabarnya
ID: 9695787
But if I have an object of AxDHTMLEDLib.AxDHTMLEdit like
AxDHTMLEDLib.AxDHTMLEdit Edit;

I get an IHTMLDocument2 object fom there like:
mshtml.DHTMLDocument2 dom = Edit.DOM ;
and then I have to attach an event handler to it like onclick or any other.
How can I do that?
Sorry if I am asking silly questions :))  
0
 

Author Comment

by:AlexanderShkabarnya
ID: 9695841
Sorry, now I understand (to slow because of beer :)) )
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question