Results 1 to 10 of 10

Thread: Hyperlink in VB Form

  1. #1
    Adept Developer
    Guest

    Hyperlink in VB Form

    How can I easily add a simple HyperLink to a form? Can I put something in the Click() event?

    -Steve

  2. #2
    Fanatic Member
    Join Date
    Apr 2001
    Posts
    843
    You could put this in the onclick event of something....



    Set x = CreateObject("InternetExplorer.Application")
    x.Visible = True
    x.navigate url



    maybe there is an easier way.....
    "The difference between mad and genius is the success"

  3. #3
    hellswraith
    Guest
    "Give a man a fish, he will eat for a day. Show the man HOW to fish, he will eat for a lifetime."

    This is a pretty common question, I think I asked before myself. Click the search button, and type in "hyperlink label" and you will get about 15 different threads on the issue.

  4. #4
    Matthew Gates
    Guest
    VB Code:
    1. Private Declare Function ShellExecute _
    2. Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As _
    3. Long, ByVal lpOperation As String, ByVal lpFile As String, _
    4. ByVal lpParameters As String, ByVal lpDirectory As String, _
    5. ByVal nShowCmd As Long) As Long
    6.  
    7.  
    8. Private Sub Label1_Click()
    9.     ShellExecute Me.hwnd, "Open", "http://www.vb-world.net", _
    10.     vbNullString, vbNullString, SW_SHOWNORMAL
    11. End Sub

  5. #5
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  6. #6
    Adept Developer
    Guest
    Thanks guys.

    I used the code that Mathew posted. The only thing I had to do is declare a constant SW_SHOWNORMAL with a value of 1.

    -Steve

  7. #7
    PowerPoster eiSecure's Avatar
    Join Date
    Jul 2000
    Location
    Texas
    Posts
    2,209
    To make the look more "real", you could make the label change color on mousemove and mouseout. And you can also set the font to underlined, Arial

  8. #8
    Adept Developer
    Guest
    I'm doing this on an Image control and there is no mouseout event. How else can I accomplish changing the mousepointer?

    -Steve

  9. #9
    anoop007
    Guest
    changing mousepointer is easy.
    There is a mouseicon property which you can set to your cursor and change the mousepointer property to 99(custom).

    There isn't mousout for any control in VB.
    Easy way..

    Code:
    Private Sub Form_MouseMove()
          Label1.Color = vbBlue
    End Sub
    
    Private Sub Image1_MouseMove()
         Label1.color = vbRed
    End Sub
    For the tough and more reliable way look in www.vbaccelerator.com

  10. #10
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    the thread I posted has code to change the cursor....
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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