Link Labels

  • Thread starter Thread starter Harry the Horse
  • Start date Start date
H

Harry the Horse

How can I make my link label open a webpage when I click
it ?

Harry
 
You need to write the code to do that.

Something like this will normally work fine:

Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
LinkLabel1.LinkClicked

Dim p As New System.Diagnostics.Process

Dim s As New System.Diagnostics.ProcessStartInfo("http://" &
LinkLabel1.Text)

s.UseShellExecute = True

s.WindowStyle = ProcessWindowStyle.Normal

p.StartInfo = s

p.Start()

End Sub

If you need to ensure that it is IE that loads (the above will load the
default browser), then you query the registry for the app path for
iexplore.exe and open the process as iexplore.exe and the arguments set to
the web site you want.

Jerry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top