473,387 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

using mshtml how to use oncontextmenu inC#

private HTMLDocumentEvents2_Event _docEvent;
private mshtml.HTMLDocument doc = null;
// private string _content = string.empty;

void gmailurl_DocumentComplete(object pDisp, ref object URL)
{
//doc = null;
//mshtml.IHTMLDocument2 doc = (IHTMLDocument2)gmailurl.Document;

//mshtml.HTMLDocumentEvents2_Event iEvent = (mshtml.HTMLDocumentEvents2_Event)doc;
//iEvent.oncontextmenu += new HTMLDocumentEvents2_oncontextmenuEventHandler(Clic kEventHandler);
//foreach (IHTMLElement link1 in doc.all)
//{
// HTMLButtonElement el = link1 as HTMLButtonElement;


//}
//foreach (IHTMLElement l in doc.all)
//{


//}

//foreach (HtmlElement element in doc.all)
//{
// HTMLButtonElement btn = lk as HTMLButtonElement;


//}
//foreach (IHTMLElement link in doc.links)
//{
// // HtmlElement ele=link.

// HTMLAnchorElement anchor = link as HTMLAnchorElement;
// if (anchor != null)
// {
// HTMLAnchorEvents_Event handler = anchor as HTMLAnchorEvents_Event;
// if (handler != null)
// {
// handler.oncontextmenu += new HTMLAnchorEvents_oncontextmenuEventHandler(delegat e()
// {
// MessageBox.Show("You clicks the link: " + anchor.href);
// return true;
// });

// }
// }
//}

//_docEvent = (HTMLDocumentEvents2_Event)gmailurl.Document;
//_docEvent.oncontextmenu += new HTMLDocumentEvents2_oncontextmenuEventHandler(_doc Event_oncontextmenu);

//if (gmailurl.Document != null)
//{
// _docEvent = (HTMLDocumentEvents2_Event)gmailurl.Document;
// _docEvent.oncontextmenu += new HTMLDocumentEvents2_oncontextmenuEventHandler(_doc Event_oncontextmenu);
//}
if (doc == null)
{
doc = (mshtml.HTMLDocument)gmailurl.Document;

mshtml.HTMLDocumentEvents2_Event iEvent = (mshtml.HTMLDocumentEvents2_Event)doc;
// iEvent.onkeydown += new mshtml.HTMLDocumentEvents2_onkeydownEventHandler(k eyDown);
iEvent.oncontextmenu += new HTMLDocumentEvents2_oncontextmenuEventHandler(Clic kEventHandler);
doc.focus();
}

above code is working but textbox is disabled so give me appropriate answer
Jun 10 '16 #1
0 1286

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Newsgroup Reader | last post by:
I'm trying to create a chat program, however I find it most of the time these days clients use HTML or some sort of markup language to render text on the screen. My question is how would I render...
2
by: Gil Schulmann | last post by:
Hi. I am trying to load an HTML file into htmlDoc using c#. I see that the document does not load, but I can not understand where am I wrong. Any help ? My Code: class CFileHandler{...
3
by: ddd | last post by:
I am trying to use MSHTML without the webbrowser and I am having a few problems. Right now all I am trying to do is load an URL(html page) and access its innerhtml. What I have is: Dim doc As...
5
by: Atara | last post by:
I am trying to convert the following code to VB .Net, I still have some gaps (the lines that are marked with (*)) and also I need an ending condition for the while loop. any help would be...
14
by: Vibhu Bansal | last post by:
Hello, I am having certain problems in trying to use the function createDocumentFromUrl in VB.NET but get this error.."Object reference not set to an instance of object". Here is the code that I...
3
by: John | last post by:
Does anyone know how to simulate the right click "Save Target As" using MSHTML? I find that I can navigate through the LinksCollection on any given page but often these links are links to files...
0
by: Atara | last post by:
Our application was build with VS 2003. I have tried to run it on a computer with .Net 2.0 (but without .Net 1.1 , as it should be used) and I got the following error - ...
1
by: Sujoan | last post by:
Hi all.. I generated SHDocVw.dll and MSHTML.dll using aximp and tlbimp commands in the folder i created my application.But when i used it in my application like using SHDocVw;using MSHTML; and...
2
by: holder | last post by:
Folks, I have a simple web page with frames. I am trying to automate internet explorer to display the page and allow access to its frames. Here is the sample code : using mshtml; static void...
0
by: Vibhu | last post by:
Hi, I need to scrape aspx pages for data using MSHTML. I am fairly comfortable using MSHTML. I need to know as to how I can submit information to aspx pages and get the results.. Any help...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.