Jump to content

What is Visual Basic code to accomplish a Hyperlink?


razz

Recommended Posts

I am using Microsoft Visual Basic 2008 Express Edition to create a project I am working on. I have used "LinkLabel" in my project which supports hyperlink. Now I just need to enter the proper code to activate the URL link that I am trying to insert. For example, one LinkLabel I have is for Google. I can't figure out the proper code, does anyone here know what the code is to accomplish this?

 

Thanks much!

Link to comment
Share on other sites

I am using Microsoft Visual Basic 2008 Express Edition to create a project I am working on. I have used "LinkLabel" in my project which supports hyperlink. Now I just need to enter the proper code to activate the URL link that I am trying to insert. For example, one LinkLabel I have is for Google. I can't figure out the proper code, does anyone here know what the code is to accomplish this?

 

I see you're using VB 2008 whereas its a doddle in VB6, all you need to do is use the ShellExecute API call. ;)

 

Option ExplicitPrivate Declare Function ShellExecute Lib "shell32.dll" _Alias "ShellExecuteA" (ByVal hwnd As Long, _ByVal lpOperation As String, ByVal lpFile As String, _ByVal lpParameters As String, ByVal lpDirectory As String, _ByVal nShowCmd As Long) As LongConst SW_SHOW = 5Private Sub lblURL_Click()'lblURL is the web link in the label you want to connect too.ShellExecute Me. hwnd, "open", lblURL.Caption, _vbNullString, vbNullString, SW_SHOWEnd Sub

 

 

This isn't the best forum for VB problems I suggest you read my sig and try the link. ;)

Keith

 

Windows XP 2002 SP3

IE 7.0

 

Martin2k

 

Rorshach112 is the best

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.