Results 1 to 7 of 7

Thread: How to make clickable hyprlink ?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Unhappy How to make clickable hyprlink ?

    Hi all . could any one tell me how i can make clickable hypherlink so once user clicks on a webpage opens and also how to add on mouse over discription to it. I be happy if some one show me how.Thanks

  2. #2
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    Re: How to make clickable hyprlink ?

    this has been discussed many times before. searching is your friend so use your friend.

  3. #3
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: How to make clickable hyprlink ?

    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4
    Hyperactive Member Jenova's Avatar
    Join Date
    Feb 2006
    Location
    Googleplex
    Posts
    413

    Re: How to make clickable hyprlink ?

    Here try this

    VB Code:
    1. '// You need 1 label
    2. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
    3.                         ByVal hwnd As Long, _
    4.                         ByVal lpOperation As String, _
    5.                         ByVal lpFile As String, _
    6.                         ByVal lpParameters As String, _
    7.                         ByVal lpDirectory As String, _
    8.                         ByVal nShowCmd As Long) _
    9.                         As Long
    10.  
    11. Private Sub Form_Load()
    12.     Label1.Caption = "Click Here"
    13.     Label1.ForeColor = vbBlue
    14. End Sub
    15.  
    16. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    17.     Label1.FontUnderline = False
    18. End Sub
    19.  
    20. Private Sub Label1_Click()
    21.     ShellExecute Me.hwnd, "open", "http://www.google.com", vbNullString, vbNullString, vbNormal
    22. End Sub
    23.  
    24. Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    25.     Label1.FontUnderline = True
    26. End Sub

    Hope this helps

    Jenova

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Re: How to make clickable hyprlink ?

    Jenova many many thanks for u nice code. could u show me how i can add a icon which looks like hand and on mouse over it shows a discription of the link.Thanks

  6. #6
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: How to make clickable hyprlink ?

    The link I posted has everything you need.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7
    Hyperactive Member Jenova's Avatar
    Join Date
    Feb 2006
    Location
    Googleplex
    Posts
    413

    Re: How to make clickable hyprlink ?

    Here you go .

    Also there is a property called ToolTipText which shows the small message. I added this in for you too

    VB Code:
    1. '// You need 1 label
    2. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
    3.                         ByVal hwnd As Long, _
    4.                         ByVal lpOperation As String, _
    5.                         ByVal lpFile As String, _
    6.                         ByVal lpParameters As String, _
    7.                         ByVal lpDirectory As String, _
    8.                         ByVal nShowCmd As Long) _
    9.                         As Long
    10.  
    11. Private Sub Form_Load()
    12.     Label1.Caption = "Click Here"
    13.     Label1.ForeColor = vbBlue
    14.     Label1.MousePointer = vbCustom
    15. End Sub
    16.  
    17. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    18.     Label1.FontUnderline = False
    19. End Sub
    20.  
    21. Private Sub Label1_Click()
    22.     ShellExecute Me.hwnd, "open", "http://www.google.com", vbNullString, vbNullString, vbNormal
    23. End Sub
    24.  
    25. Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    26.     Label1.FontUnderline = True
    27.     Label1.ToolTipText = "This is a hyperlink!"
    28.     Label1.MouseIcon = LoadPicture("C:\WINDOWS\Cursors\harrow.cur")
    29. End Sub

    Hope this helps

    Jenova
    Last edited by Jenova; Apr 22nd, 2006 at 05:11 PM.

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