Results 1 to 3 of 3

Thread: hyperlink on click

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    Dullawhere
    Posts
    100

    Question

    How do I make a hyperlink for a click?

    Private Sub WebSite_Click()

    ???????????????????????

    End Sub

  2. #2
    Guest
    Try this:
    Code:
    Private 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
    
    Private Sub WebSite_Click()
        'Open http://www.vb-world.net
        Retval = ShellExecute(0&, vbNullString, "www.vb-world.net", vbNullString, "C:\", 1)
    End Sub

  3. #3
    Addicted Member hypnos's Avatar
    Join Date
    Aug 2000
    Location
    UK
    Posts
    183
    Add this to the click event

    Code:
    Public Const URL = "http://www.vb-world.net"
    
    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
    
    Public Sub gotoweb()
    Dim Success As Long
    
    Success = ShellExecute(0&, vbNullString, URL, vbNullString, "C:\", SW_SHOWNORMAL)
    
    End Sub
    Got this from a program off of this site.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width