-
while we are discussing the hyperlink thing, can someone show me how to change the mouse pointer to the hand icon when it is over a hyperlink? I have the link in a label called lblHyperlink. I know it will have something to do with either the label's or the form's mousemove routine, but as I have never used that routine before, I am clueless!
Also, does anyone have the .ico file for the hand pointer? I can't find it.
Thanks
Andrew
-
It is the Label's MouseMove routine. The icon for the hand is located in iexplore.exe
-
Option Explicit
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
Try this:
'put an image and name it - imgHand
Private Const SW_SHOWNORMAL = 1
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.MousePointer = vbDefault
End Sub
Private Sub lblHyperlink_Click()
lReturn = ShellExecute(hWnd, "open", "www.vb-world.net", vbNull, vbNull, SW_SHOWNORMAL)
End Sub
Private Sub lblHyperlink_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.MousePointer = 99
Me.MouseIcon = imgHand.Picture
End Sub
-
Sorry the code got mixed up !!
Option Explicit
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
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.MousePointer = vbDefault
End Sub
Private Sub lblHyperlink_Click()
Dim lReturn As Long
lReturn = ShellExecute(hWnd, "open", "www.vb-world.net", vbNull, vbNull, SW_SHOWNORMAL)
End Sub
Private Sub lblHyperlink_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.MousePointer = 99
Me.MouseIcon = imgHand.Picture
End Sub
-
Okay, that works for changing the icon. but parksie - iexplore.exe is a program and not a folder. Also I searched for all *.ico files on my system and still couldn't find it. It is an .ico file, right?
-
It is not stored in an .ico file, and it is stored INSIDE iexplore.exe. However, there is a .cur file for it supplied with Windows 2000 - so here it is: http://www.parksie.uklinux.net/Harrow.cur
-
Ah! Okay, gotcha. Thanks for the link, but I don't need it now since i looked in the Cursors folder in visual studio, and there are several of them.