Associating a hyperlink with an event

sudhanshu22

Member
Joined
Nov 8, 2006
Messages
20
Programming Experience
Beginner
Hi all,
I would like that when user clicks on a button, a hyperlink should open.
For e.g. on clicking button, an internet explorer etc should appear with say
http://sdfasfa.com

How can I do so ?

Thanks
sudhanshu
 
Add this code to button click event handler:
VB.NET:
Process.Start("[URL]http://akdfjh.com[/URL]")
 
if you have a linklabel on the form already and want to execute that code from a button simply do this:
VB.NET:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Call LinkLabel1_Click(LinkLabel1, Nothing)
    End Sub

    Private Sub LinkLabel1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkLabel1.Click
        Process.Start("IExplore", "http://www.vbdotenetforums.com")
    End Sub
it's not the greatest, but it gets the job done
 
Back
Top