WebBrowser ctrl: switch off context menu in C#?

  • Thread starter Thread starter Guenter Rudolph
  • Start date Start date
G

Guenter Rudolph

Hi,
I am using the AxSHDocVw.AxWebBrowser
web browser control in my windows forms
application in C# and I would like to
switch off the context menu of the browser.

Currently, I only found a solution for c/c++:
It seems that one has to implement the
IDocHostUIHandler interface, which should
be defined in the mshtml assembly.
Apparently, it is not there.

Any ideas? Other solutions welcome as well!

Thanks in advance,
Guenter
 
Hello,

Guenter Rudolph said:
I am using the AxSHDocVw.AxWebBrowser
web browser control in my windows forms
application in C# and I would like to
switch off the context menu of the browser.

If you can change the code of the HTML page, just add this line:

\\\
<body onContextMenu="return false">
///

Regards,
Herfried K. Wagner
 
Hello,

rc said:
this is a javascript within the BODY tag.

<BODY oncontextmenu='javascript:return false;'>

Ooops. You are right.

Regards,
Herfried K. Wagner
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top