Results 1 to 6 of 6

Thread: [RESOLVED] url link question

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    2

    Resolved [RESOLVED] url link question

    Hi all

    Im new to this and am building a little tool and at the botom i want to put a copyright notice and a link that when clicked will open there browser and take them to my website?

    But i have no clue how to make this happen

    Any and all help would be really appreciated

    Thanks
    Mark

  2. #2
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: url link question

    Welcome to the forum!

    not to hard

    'Put this in the Declaration/top section of the form:
    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 Const SW_SHOWNORMAL = 1
    Now add a label named lblLink, put your copyright in it's Caption and add this code to the form:
    Code:
     
    Private Sub lblLink_Click()
        Dim iReturn As Long
        Dim sURL As String
    
        'change this url to your own
        sURL = "http://www.MySite.com"
        iReturn = ShellExecute(Me.hwnd, "Open", sURL, vbNullString, App.Path, SW_SHOWNORMAL)
    End Sub

    Edit, added the constant
    Last edited by longwolf; Nov 7th, 2008 at 09:37 AM.

  3. #3
    Hyperactive Member danecook21's Avatar
    Join Date
    Feb 2008
    Location
    NC, USA
    Posts
    501

    Re: url link question

    I decided to put together a quick sample showing how I make a link out of a label. It is attached.
    Attached Files Attached Files

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    2

    Re: url link question

    Thats great !!!!!


    Thanks very much for both your help ( i can sleep easy now )

    Thanks
    Mark

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: url link question

    Welcome to the forums.

    As a newer member I ask that if you consider your question to be resolved please help us out by pulling down the Thread Tools menu and clicking the Mark Thread Resolved menu item. That will let everyone know that you have your answer.

    Thank you.

  6. #6
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: url link question

    Quote Originally Posted by mnporter2001
    ( i can sleep easy now )

    Thanks
    Mark
    lol, well, I wouldn't lose sleep over a thing like that

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