Mouse Over

  • Thread starter Thread starter David Tunny
  • Start date Start date
D

David Tunny

Please help,

(I've tried using the search function but it keeps saying
error)

I am looking for help changing the mouse over code to
change the cursor to a hand when over a command button.

Thanks in advance
David
 
-----Original Message-----
Please help,

(I've tried using the search function but it keeps saying
error)

I am looking for help changing the mouse over code to
change the cursor to a hand when over a command button.

Thanks in advance
David
.
Hi David

I was looking for the same thing some months ago and got
the answer from this group.

Try this.In design view of your form right click on the
command button to open the properties sheet. Select the
all tab and move down to the hyperlink address. In the
hyperlink box press the spacebar once and close your form
and save the change. The next time you move your pointer
over the button it will change to a hand.

Good luck

Chris
 
David,
I assume you mean the mouse move event, as there is no mouse over... The
only way I know of changing the mouse icons, other than the ones listed in
MousePointer, is to use an ActiveX control(in this case CommandButton6 -MS
Control), draw your own icon and save to some disk location. You need to
discover the XY coordinates to outline the location of the control - you can
do that with the textboxes. Then define the XY parameters and use the if
then statement to assign your new mousepointer.

Put this code in the form load event:
Dim iconpath As String
iconpath = "c:\Your Path\some.ico"
CommandButton6.MouseIcon = LoadPicture(iconpath)

then in the detail section of the form, use:
Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Me!Text0 = X
Me!Text2 = Y
If (X > 8750 And X < 9500) And (Y > 425 And Y < 945) Then
CommandButton6.MousePointer = 99
End If
End Sub

HTH
Damon
 
Just a correction in my previous post.... you dont need the xy coordinates!
just the statement
CommandButton6.MousePointer = 99
in the mousemove event of the detail section.

Damon
 
Boy, do I feel dumb! I thought about the hyperlink idea, but went for the
convoluted, extreme solution instead!

Damon
(but at least with mine, you can create cute icons:)
 
Cheers Damon anyway,

I'll go for the easy option at the moment but I'll
definatly give yours a go.

Thanks again
David
 
Works a treat - bloody marvellous. Cheers
-----Original Message-----

Hi David

I was looking for the same thing some months ago and got
the answer from this group.

Try this.In design view of your form right click on the
command button to open the properties sheet. Select the
all tab and move down to the hyperlink address. In the
hyperlink box press the spacebar once and close your form
and save the change. The next time you move your pointer
over the button it will change to a hand.

Good luck

Chris
.
 
Damon Heron said:
Boy, do I feel dumb! I thought about the hyperlink idea, but went
for the convoluted, extreme solution instead!

Damon
(but at least with mine, you can create cute icons:)

You can also use the code posted here:

http://www.mvps.org/access/api/api0044.htm

to set the mouse pointer to a system-defined icon or one you create,
without using an ActiveX control.
 
Back
Top