views:

112

answers:

2

I am using special program where it loads some url imagine it like window with automatically load www.google.com - program starts and it load the site - BUT when you click on some links in the program window it opens in default browser - how it can be opened in default browser - I am using this code:

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
Inherits System.Windows.Forms.Form

<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
    Try
        If disposing AndAlso components IsNot Nothing Then
            components.Dispose()
        End If
    Finally
        MyBase.Dispose(disposing)
    End Try
End Sub

Private components As System.ComponentModel.IContainer
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
    Me.components = New System.ComponentModel.Container
    Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
    Me.WB = New System.Windows.Forms.WebBrowser
    .....
    .....

Me.WB.Url = New System.Uri("http://www.google.com/", System.UriKind.Absolute)

Using Visual Basic 2008

A: 

If I understand your question correctly (let me know if I am wrong), you are asking how to open the system default browser on a specific URL. This can be achieved like this:

Process.Start("http://www.example.com/")

If the path is stored in a Uri object, you will need to use its ToString() method:

Process.Start(someUri.ToString())
Jørn Schou-Rode
No ... Imagine program with a lot of buttons and there is a small window which loads www.example.com like in browser - but it opens it in program and when you click on some link in it - that i want to open in default browser - hope it is understandable...
Hallgaws
I guess you will have to capture all click events on the `WebBrowser`, somehow determine if the click is on a link and then use `Process.Start()` to spawn a separate browser application. "How to capture the clicks on links in `WebBrowser`" is really what you question is about, then?
Jørn Schou-Rode
if there is not a simplier solution than yes that is my question ...
Hallgaws
A: 

Still nobody knows the solution?

Hellgaws