How to cancel user-clicks in AxWebBrowser

G

Guest

Hi,

I am trying to present HTML in the AxWebBrowser control, but I want to
cancel the even of user-clicks, since I don't want to user to navigate any
further than the presented page. Any ideas?
 
G

Guest

OS said:
Hi,

I am trying to present HTML in the AxWebBrowser control, but I want to
cancel the even of user-clicks, since I don't want to user to navigate any
further than the presented page. Any ideas?
 
C

Cor Ligthert

Hi

How are you able to browse (except using links on a page) in that control
when you did not set yourself on a form a button and than use commands as
navigateforward and backward or/and set an urlbox on that form, which does
the navigate command.

Cor
 
G

Guest

I am loading HTML into a document object:

Here is the code:

TextReader tr = new StreamReader("C:\\html.txt");
string file = tr.ReadToEnd();
object empty = System.Reflection.Missing.Value;
axWebBrowser1.Navigate("about:blank", ref empty, ref empty, ref empty, ref
empty);
mshtml.IHTMLDocument2 doc = axWebBrowser1.Document as mshtml.IHTMLDocument2;
doc.writeln(file);
doc.clear();
doc.close();

But now, after the document is loaded, I don't want to allow the user to
click on the links.
 
C

Cor Ligthert

OS,

Than why do you than before that you add them to the page removing the hrefs
from that what in fact is a string.

Just my thought,

Cor
 

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

Top