|
-
Apr 22nd, 2006, 02:47 PM
#1
Thread Starter
Frenzied Member
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
-
Apr 22nd, 2006, 03:25 PM
#2
PowerPoster
Re: How to make clickable hyprlink ?
this has been discussed many times before. searching is your friend so use your friend.
-
Apr 22nd, 2006, 03:57 PM
#3
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Apr 22nd, 2006, 04:25 PM
#4
Re: How to make clickable hyprlink ?
Here try this
VB Code:
'// You need 1 label
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 Form_Load()
Label1.Caption = "Click Here"
Label1.ForeColor = vbBlue
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.FontUnderline = False
End Sub
Private Sub Label1_Click()
ShellExecute Me.hwnd, "open", "http://www.google.com", vbNullString, vbNullString, vbNormal
End Sub
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.FontUnderline = True
End Sub
Hope this helps 
Jenova
-
Apr 22nd, 2006, 04:53 PM
#5
Thread Starter
Frenzied Member
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
-
Apr 22nd, 2006, 05:02 PM
#6
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Apr 22nd, 2006, 05:03 PM
#7
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:
'// You need 1 label
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 Form_Load()
Label1.Caption = "Click Here"
Label1.ForeColor = vbBlue
Label1.MousePointer = vbCustom
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.FontUnderline = False
End Sub
Private Sub Label1_Click()
ShellExecute Me.hwnd, "open", "http://www.google.com", vbNullString, vbNullString, vbNormal
End Sub
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.FontUnderline = True
Label1.ToolTipText = "This is a hyperlink!"
Label1.MouseIcon = LoadPicture("C:\WINDOWS\Cursors\harrow.cur")
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|