Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I change the cursor on a "mouse move" event 4

Status
Not open for further replies.

Modex

Programmer
Sep 15, 2002
155
GB
Hi all

Got another question, please.

I had a little help the other day in getting a web page to load from a click event in access by clicking on a picture, however the mouse pointer stays as a pointer when moved over the picture,

So, my question is, is there a way to change the cursor to the web standard hyperlink cursor of a “pointing finger” when the mouse is over the graphic, I know you should use the “on mouse move” event on the picture but have no idea what code to write to make the cursor behave in such a fashion.

Once again, any help would be gratefully received.

Also , does anyone know if there is an archive of all the tips that come and go in this forum.

Many thanks

ModeX
 
Modex,
create a module called Handover, and enter the following code -

Option Compare Database
Option Explicit

'*********** Code Start ************
' This code was originally written by Terry Kreft.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Terry Kreft
'
Public Const IDC_APPSTARTING = 32650&
Public Const IDC_HAND = 32649&
Public Const IDC_ARROW = 32512&
Public Const IDC_CROSS = 32515&
Public Const IDC_IBEAM = 32513&
Public Const IDC_ICON = 32641&
Public Const IDC_NO = 32648&
Public Const IDC_SIZE = 32640&
Public Const IDC_SIZEALL = 32646&
Public Const IDC_SIZENESW = 32643&
Public Const IDC_SIZENS = 32645&
Public Const IDC_SIZENWSE = 32642&
Public Const IDC_SIZEWE = 32644&
Public Const IDC_UPARROW = 32516&
Public Const IDC_WAIT = 32514&

Declare Function LoadCursorBynum Lib "user32" Alias "LoadCursorA" _
(ByVal hInstance As Long, ByVal lpCursorName As Long) As Long

Declare Function LoadCursorFromFile Lib "user32" Alias _
"LoadCursorFromFileA" (ByVal lpFileName As String) As Long

Declare Function SetCursor Lib "user32" _
(ByVal hCursor As Long) As Long

Function MouseCursor(CursorType As Long)
Dim lngRet As Long
lngRet = LoadCursorBynum(0&, CursorType)
lngRet = SetCursor(lngRet)
End Function

Function PointM(strPathToCursor As String)
Dim lngRet As Long
lngRet = LoadCursorFromFile(strPathToCursor)
lngRet = SetCursor(lngRet)
End Function
'*********** Code End ************



Then, in the OnMouseMove event of your label/graphic/whatever, enter the code -

'********* code start **********
MouseCursor (32649)
'********** code end ***********


This worked for me.

Kev.

 
I tried this code and works great for me aswell, thanks for posting it Kev
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top