[AccessD] Turn Mouse Pointer to Hand

Heenan, Lambert Lambert.Heenan at AIG.com
Tue Jul 26 10:28:31 CDT 2005


OK. I got it, this time using the API route. Put this code in a module...

Public Const HandCursor = 32649&

Declare Function LoadCursorBynum Lib "user32" Alias "LoadCursorA" _
 (ByVal hInstance As Long, ByVal lpCursorName As Long) 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

...Then all you need is a MouseMove event for the label which reads...

    MouseCursor HandCursor

Access will automatically restore the default cursor when you move out of
the label's area.

Lambert


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin -
Beach Access Software
Sent: Tuesday, July 26, 2005 10:56 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Turn Mouse Pointer to Hand


Rick:

I was looking for that snip that changes the muse pointer into a hand.  I've

got labels on the main form with OnClick events instead of command buttons 
(which are clunky looking).  I've also got a mouse move event for each one 
already which displays a bit of description of the label's function.

Now, in that mouse move event, I'd like to change the pointer to a hand as a

visual cue that the label is a clickable link of some sort.  I'm gilding the

lily here a bit, but it's a consumer product, not a commercial application, 
so it wants a bit of sizzle.

I did this before and it worked real well.  I just can't remember the app I 
built it into so I can't find it again.

Thanks and regards,

Rocky

----- Original Message ----- 
From: "Ehlers, Rick" <Rick.Ehlers at cinergy.com>
To: "Access Developers discussion and problem solving" 
<accessd at databaseadvisors.com>
Sent: Tuesday, July 26, 2005 7:17 AM
Subject: RE: [AccessD] Turn Mouse Pointer to Hand


> Rocky,
>
> I use
>
> DoCmd.Hourglass True before the code starts
> and
>      DoCmd.Hourglass False after the code ends
>
> to change the pointer. Is this what you are thinking of?
>
>
> Rick Ehlers
>  Power Services
>  Performance And Valuation
>  Annex - EX510
>  Phone: (513) 287-2047
>  Fax: (513) 287-3698
>  EMail: Rick.Ehlers at cinergy.com
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky 
> Smolin
> - Beach Access Software
> Sent: Tuesday, July 26, 2005 10:04 AM
> To: AccessD at databaseadvisors.com
> Subject: [AccessD] Turn Mouse Pointer to Hand
>
> Dear List:
>
> Many moons ago I someone on the list gave me some code to turn the 
> mouse pointer into the hand which now indicated you're hovering over a 
> link, and I used it in the mouse move event of a label which had it's 
> own click event.
>
> But I can't find it.  Does anyone remember that?  It was, IIRC, only 
> 2-3 lines of code.
>
> MTIA,
>
> Rocky
> --
> AccessD mailing list
> AccessD at databaseadvisors.com 
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list