
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