Oct 7th, 2007, 06:33 PM
#1
Thread Starter
New Member
Link to a web site
I want to click on a button within a VB6 application, which opens the standard Internet Explorer browser and automatically navigates to a web site.
Can anyone please give me some help on how to do this with VB6
thanks
Oct 7th, 2007, 06:46 PM
#2
Re: Link to a web site
Wow, this seems topical lately. Homework assignment?
This functionality is built into VB6. Any UserControl can do it.
This example uses a Label to be the Hyperlink, but one could easily make it a button:
Code:
Private Sub lblLink_Click()
If Len(m_URL) > 0 Then
HyperLink.NavigateTo m_URL, m_Bookmark
End If
End Sub
See attached demo.
Attached Files
Oct 7th, 2007, 07:59 PM
#3
Re: Link to a web site
Here is another method.
vb Code:
'Put this in a module
Public 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 Long
Public Const SW_SHOWNORMAL = 1
'Put this in a form
Private Sub lblSite_Click()
ShellExecute Me.hWnd, vbNullString, "http://www.vbforums.com", vbNullString, "C:\", SW_SHOWNORMAL
End Sub
Oct 8th, 2007, 02:50 AM
#4
Thread Starter
New Member
Re: Link to a web site
Wonderful,
thanks
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width