WebBrowser

P

philip

Is it possible, on a WebBrowser control, to intercept a HyperLink and react
programmatically to this click ?
That's my first question.

In fact, I use the Webbrowser as a sort of report (I write the html code and
tables programmatically in a string, and I give the string to the property
DocumentText of the WebBrowser, and I insert in this code some Hyperlinks by
wich I could react, launching an specific action)
The properties ShowPrintPreviewDialog and others 'Show...' properties of the
WebControl are very interresting, and sometimes better then using true
Reports or CrystalReports

The second question is : is there a document somewhere who discuss on this
subject, comparing CrystalReports and use of WebBrowser in their function of
showing reports ? I try to explore this way.

Thanks for your response
 
C

Charles Law

Hi Philip

You can handle the BeforeNavigate2() event and do your own thing.

HTH

Charles
 
P

philip

I don't discover this event in WebBrowser.
I have Visual Studio 2005.
Is it normal ?
Must I have a reference ?

Thanks for your help

Philip
 
P

philip

I don't discover this event in WebBrowser.
I have Visual Studio 2005.
Is it normal ?
Must I ADD a reference ?

Thanks for your help

Philip
 
P

philip

Perhaps the event 'Navigating' replace the 'BeforeNavigate2' event ?
I can use e.Cancel to cancel and do my own thing.

But now, how can I know which HyperLink has been clicked ?

Thanks for help, Charles.

Philip
 
P

philip

But now, how can I know which HyperLink has been clicked ?

Thanks for help, Colin.

Philip
 
C

Colin Neller

Perhaps the event 'Navigating' replace the 'BeforeNavigate2' event ?
I can use e.Cancel to cancel and do my own thing.
That is correct. The 2005 WB changes the event name to "Navigating"
But now, how can I know which HyperLink has been clicked ?
It would help to know exactly what you're trying to do. If you need to know
the specific anchor tag that was clicked, then you'll actually need to sink
the events from the HTMLDocument its self and capture the "onclick" event
rather than the "Navigating" event.
 
P

philip

I found e.Url in the event Navigating.
I can know which hyperlink was clicked.
Thank you for your help, sincerely.

Philip
 

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

Similar Threads


Top