Home All Groups Group Topic Archive Search About

WebBrowser control problem

Author
5 Jan 2005 10:08 PM
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
Author
6 Jan 2005 11:05 AM
Jeff Gaines
On 05/01/2005 Vibor Cipan wrote:

> 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.

--
Jeff Gaines
Posted with XanaNews 1.17.1.2 http://www.wilsonc.demon.co.uk/delphi.htm
Author
6 Jan 2005 2:45 PM
Vibor Cipan
Hi Jeff,
Can u please respond to my mail, since i don't know ur email addres


Thank You!
Vibor


"Jeff Gaines" <whitedragon@newsgroup.nospam> je napisao u poruci interesnoj
grupi:xn0dwxk875lo83***@news.microsoft.com...
Show quoteHide quote
> On 05/01/2005 Vibor Cipan wrote:
>
>> 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.
>
> --
> Jeff Gaines
> Posted with XanaNews 1.17.1.2 http://www.wilsonc.demon.co.uk/delphi.htm
Author
6 Jan 2005 11:47 AM
Brian Cryer
Show quote Hide quote
"Vibor Cipan" <ci***@ifs.hr> wrote in message
news:crhofu$d73$1@bagan.srce.hr...
> 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
Author
6 Jan 2005 3:52 PM
Brian Cryer
Show quote Hide quote
"Brian Cryer" <bri***@127.0.0.1.activesol.co.uk> wrote in message
news:1105012063.24737.0@ersa.uk.clara.net...
> "Vibor Cipan" <ci***@ifs.hr> wrote in message
> news:crhofu$d73$1@bagan.srce.hr...
> > 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

Sorry, its BeforeNavigate2 - OnBeforeNavigate was in my mind from my Delphi
stuff.
Author
6 Jan 2005 3:48 PM
Jeff Johnson [MVP: VB]
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.
Author
6 Jan 2005 4:08 PM
Vibor Cipan
"Jeff Johnson [MVP: VB]" <i.get@enough.spam> je napisao u poruci interesnoj
grupi:uaJh8cA9EHA.2***@TK2MSFTNGP14.phx.gbl...
> 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 :-)
Author
8 Jan 2005 12:06 PM
nrford
Check out http://www.hsv-life.com/fordsoft/HTMLfileViewer.zip

NFord

Show quoteHide quote
"Vibor Cipan" <ci***@ifs.hr> wrote in message
news:crhofu$d73$1@bagan.srce.hr...
> 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
>