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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing the mouse pointer style. 2

Status
Not open for further replies.

postmanphat

Technical User
Nov 13, 2006
117
0
0
GB
Hi...

Pretty straightforward (I hope!) problem...

I simply want the arrow style mouse pointer to change into the hand or finger (like you get when hovering over a hyperlink) for the buttons in my dbase.

Is there somewhere in the buttons properties that dictates the mouse pointer style when the cursor is over that button (OnMuseMove?) or what???

Many kind thanks in advance
 
What I forgot to mention in my original question is that I want this to happen just in an .mdb I've put together in Access 2003!!! Can't believe I forgot to say that.....

So yeah, in access, how do you change the behaviour of the mouse pointer?!

Thanks
 
I cannot recall who I 'borrowed' this from.

Form:
Code:
Private Sub lblCmdClose_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    ChangeMouseToHand
End Sub

Module:
Code:
Option Compare Database
Option Explicit

Public Declare Function LoadCursor Lib "user32" Alias _
    "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
Public Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Public Const IDC_HAND = 32649

Function ChangeMouseToHand()
Dim hCur As Long
    
    hCur = LoadCursor(0, IDC_HAND)
    
    If (hCur > 0) Then
        SetCursor hCur
    End If
End Function
 
Cheers Remou... Hasn't worked though unfortunately. Is the first bit of your code supposed to go on the MouseMove property of the button or the form???
 
Yes, or any control, and the second part is suposed to go in a module. I have used this code with three versions of Access, and it worked for me.
 
It doesn't like calling the module 'changecasetohand'... I get an error message saying that the first bit of code (that I have used on the MouseMove property of the button itself) is:

Compile Error:
Expected variable or procedure, not module.


Any ideas?
 
Did you say the module with the same name? Save the module with a different name.
 
Remou... you and the person you 'borrowed' this code off are bloody legends. Cheers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top