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 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.