WebBrowser control problem

  • Thread starter Thread starter Vibor Cipan
  • Start date Start date
V

Vibor Cipan

Hi

I have two webbrowser controls on my form web1 and web2. I load some HTML in
web1, and that HTML file contains links. How to make following thing - when
i click on link in web1 control, to load content (loacal file) associated
with that link in web2 kontrol.

second question... how can i open let's say frmExample when i click a link
in HTML file "Example" and frmMultimedia when i click "Multimedia"?

Please, I'm trying to solve this problmes, but i don't have ide what to do
next...

Thank you in advance
 
Hi

I have two webbrowser controls on my form web1 and web2. I load some
HTML in web1, and that HTML file contains links. How to make
following thing - when i click on link in web1 control, to load
content (loacal file) associated with that link in web2 kontrol.

Trap the NavigateComplete2 event for web1:

private void Web1_NavigateComplete2(object sender,
AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event e)
{
object obPath = e.uRL;
object obNull = null;
Web2.Navigate2(ref obPath, ref obNull, ref obNull, ref obNull, ref
obNull);
}

second question... how can i open let's say frmExample when i click a
link in HTML file "Example" and frmMultimedia when i click
"Multimedia"?

I would thin you need to set the links to point to the executable, I
think then when you click you will get the usual option to run or save
the file.
Somebody else may have a better idea though.
 
Vibor Cipan said:
Hi

I have two webbrowser controls on my form web1 and web2. I load some HTML in
web1, and that HTML file contains links. How to make following thing - when
i click on link in web1 control, to load content (loacal file) associated
with that link in web2 kontrol.

second question... how can i open let's say frmExample when i click a link
in HTML file "Example" and frmMultimedia when i click "Multimedia"?

Please, I'm trying to solve this problmes, but i don't have ide what to do
next...

Thank you in advance

You need to implement the OnBeforeNavigate event handler in your form. This
will give you the URL that has been clicked and you have the opportunity to
cancel the navigation. You will need to capture the click on a link from
your first window, respond to it in your other window and then cancel the
navigation in your first window.

Hope this helps,

Brian

www.cryer.co.uk/brian
 
Hi Jeff,
Can u please respond to my mail, since i don't know ur email addres


Thank You!
Vibor
 
Please do not crosspost questions between .NET and non-.NET groups unless
your question actually pertains to both versions of VB. The *.vb.* groups
are for VB6 and earlier.
 
Brian Cryer said:
HTML

You need to implement the OnBeforeNavigate event handler in your form. This
will give you the URL that has been clicked and you have the opportunity to
cancel the navigation. You will need to capture the click on a link from
your first window, respond to it in your other window and then cancel the
navigation in your first window.

Hope this helps,

Brian

www.cryer.co.uk/brian

Sorry, its BeforeNavigate2 - OnBeforeNavigate was in my mind from my Delphi
stuff.
 
Jeff Johnson said:
Please do not crosspost questions between .NET and non-.NET groups unless
your question actually pertains to both versions of VB. The *.vb.* groups
are for VB6 and earlier.


OK, My fault, won't happen again :-)
 
Back
Top