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
Printable View
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
this has been discussed many times before. searching is your friend so use your friend.
Here is one in CodeBank - http://www.vbforums.com/showthread.php?t=234469
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 :wave:
Jenova
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
The link I posted has everything you need. ;)
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