how do i get the hand mouse pointer to show over an image, it isn't included with vb6.
thanks in advance
chris1990
Printable View
how do i get the hand mouse pointer to show over an image, it isn't included with vb6.
thanks in advance
chris1990
You really don't need the image itself:
Code:Option Explicit
Private Const IDC_HAND = 32649&
Private Declare Function LoadCursor Lib "user32" _
Alias "LoadCursorA" _
(ByVal hInstance As Long, _
ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor Lib "user32" _
(ByVal hCursor As Long) As Long
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
SetCursor LoadCursor(0, IDC_HAND)
End Sub
thanks:)
you can also set the mousecursor style to 99 and have the MouseIcon property the hand cursor.
But that requires the actual image to be embeded in your application (say image control or resource) or physical binary file.
Instead you get it from the source - user32 library is available on every system.
Also, the closest cursor I could find that matched the hand you see in most apps is harrow.cur in %windir%\cursors. But it doesn't look that good.