Using WebBrowser control load URL in a separate Browser OR any other control 
Author Message
 Using WebBrowser control load URL in a separate Browser OR any other control

Dear VB Experts,

We are using VB6 to develop an application. Our requirement is to
display some text (not fixed, even can be entered by user) in an
appropriate control, which can enable URLs/Hyperlinks so that if user
clicks on one such entry (URL/Hyperlink), the link under the mouse
should be automatically loaded in a SEPARATE default browser.

By looking different options, we found that WebBrowser control shipped
with VB could display the URLs in enabled form. The text can be
assigned to this control in various ways like:

1).   WB1.Navigate2 "about:" & "<html><body>This is test text <P><A
href= http://www.*-*-*.com/ ; http://www.*-*-*.com/ ;/A></body></html>"

2).   WB1.Document.body.innerhtml = "<html><body>This is test text
<P><A href= http://www.*-*-*.com/ ; http://www.*-*-*.com/ ;/A></body></html>"

3).   WB1.Document.Write "<html><body>This is test text <P><A
href= http://www.*-*-*.com/ ; http://www.*-*-*.com/ ;/A></body></html>"

The problem is that when I click on a URL, it is loaded in the same
control. Whereas I wish to display it in default browser separately,
like right-click a link and select Open In New Window type of
functionality. Because my aim is just to display URLs in enabled form
to facilitate the user and not to provide browser like functionality
in the application. I searched this on web, people have suggested that
"NewWindow2" event can be used to display a URL in a separate window
by setting Cancel parameter. However, this event is not fired
directly!

Can anybody help me out this problem? Basically my aim is to load URL
in a separate browser. Even, if you have experienced any other control
that posses the same functionality I'll be glad to test that out. I
would prefer to avoid using 3rd party controls.

Any assistance will be highly appreciated. Thanks in advance.

Regards

Faiz



Sun, 13 Nov 2005 18:40:53 GMT  
 Using WebBrowser control load URL in a separate Browser OR any other control
you can specify this in your anchor tag through target attribute. check this
out:

 <a href="your_url_here" target="_blank">your link text here</a>

also, note that about: protocol has a limitation on the size of the HTML you
can compose -- i think it's 1024 characters or smaller.

HTH,
</wqw>


Quote:
> Dear VB Experts,

> We are using VB6 to develop an application. Our requirement is to
> display some text (not fixed, even can be entered by user) in an
> appropriate control, which can enable URLs/Hyperlinks so that if user
> clicks on one such entry (URL/Hyperlink), the link under the mouse
> should be automatically loaded in a SEPARATE default browser.

> By looking different options, we found that WebBrowser control shipped
> with VB could display the URLs in enabled form. The text can be
> assigned to this control in various ways like:

> 1).   WB1.Navigate2 "about:" & "<html><body>This is test text <P><A
> href=http://www.msn.com/>http://www.msn.com/</A></body></html>"

> 2).   WB1.Document.body.innerhtml = "<html><body>This is test text
> <P><A href=http://www.msn.com/>http://www.msn.com/</A></body></html>"

> 3).   WB1.Document.Write "<html><body>This is test text <P><A
> href=http://www.msn.com/>http://www.msn.com/</A></body></html>"

> The problem is that when I click on a URL, it is loaded in the same
> control. Whereas I wish to display it in default browser separately,
> like right-click a link and select Open In New Window type of
> functionality. Because my aim is just to display URLs in enabled form
> to facilitate the user and not to provide browser like functionality
> in the application. I searched this on web, people have suggested that
> "NewWindow2" event can be used to display a URL in a separate window
> by setting Cancel parameter. However, this event is not fired
> directly!

> Can anybody help me out this problem? Basically my aim is to load URL
> in a separate browser. Even, if you have experienced any other control
> that posses the same functionality I'll be glad to test that out. I
> would prefer to avoid using 3rd party controls.

> Any assistance will be highly appreciated. Thanks in advance.

> Regards

> Faiz



Sun, 13 Nov 2005 19:35:06 GMT  
 Using WebBrowser control load URL in a separate Browser OR any other control


Wed, 18 Jun 1902 08:00:00 GMT  
 Using WebBrowser control load URL in a separate Browser OR any other control
Thank you very much for your help. It is working fine.

One more thing, when I get printing from WebBrowser control it
displays header (Page 1 of 1) and footer
(about:<html><body>This%20is....) on each page. I wish to display
customize(my own) header/footer on the page. Is it Possible? Can
header/footer be suppressed as well?

Thanks in advance

Regards,

Faiz

Quote:

> you can specify this in your anchor tag through target attribute. check this
> out:

>  <a href="your_url_here" target="_blank">your link text here</a>

> also, note that about: protocol has a limitation on the size of the HTML you
> can compose -- i think it's 1024 characters or smaller.

> HTH,
> </wqw>



Tue, 15 Nov 2005 13:22:11 GMT  
 Using WebBrowser control load URL in a separate Browser OR any other control


Wed, 18 Jun 1902 08:00:00 GMT  
 Using WebBrowser control load URL in a separate Browser OR any other control
Thank you very much for your help. It is working fine.

One more thing, when I get printing from WebBrowser control it
displays header (Page 1 of 1) and footer
(about:<html><body>This%20is....) on each page. I wish to display
customize(my own) header/footer on the page. Is it Possible? Can
header/footer be suppressed as well?

Thanks in advance

Regards,

Faiz

Quote:

> you can specify this in your anchor tag through target attribute. check this
> out:

>  <a href="your_url_here" target="_blank">your link text here</a>

> also, note that about: protocol has a limitation on the size of the HTML you
> can compose -- i think it's 1024 characters or smaller.

> HTH,
> </wqw>



Fri, 18 Nov 2005 14:21:32 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Using WebBrowser control - can you trap incoming HTML before browser gets it

2. Web Browser control - problem loading ActiveX controls

3. Bringing up the IE Web browser control with a literal string rather than a URL

4. WebBrowser control URL wont preserve CAPS causes...Auhentication errors

5. Need control which links to a browser when clicking a url

6. 2083 Character Limit in URL in WebBrowser control

7. WebBrowser control: How to detect the URL

8. Annoying WebBrowser Control behavior(Open URL)

9. "Real" URL in webbrowser control

10. VB6 Web Browser-Loading URL's from a sequential file

11. ******How to send a URL and load Defualt Browser!*****

12. VB6 Web Browser-Loading URL's from a sequential file

 

 
Powered by phpBB® Forum Software