Command Button Rollovers

B

Brandon

I am going crazy trying to figure out how to get the mouse pointer to display
a pointer finger when it is over a button. Also, Is there a good way to
display an alternate image on the button only when the mouse is directly on
it?

Thanks for any help
 
R

Rick Brandt

Brandon said:
I am going crazy trying to figure out how to get the mouse pointer to
display a pointer finger when it is over a button.

Set the HyperLinkSubAddress property of the button to a single space
character.
Also, Is there a
good way to display an alternate image on the button only when the
mouse is directly on it?

You can experiment with the MouseMove event, but it is hard to make that
reliable as you have to use the MouseMove event of the section around the
button to set it back. We don't have MouseOver and MouseOff events like
some environments do. Plus MouseMove fires continuously as you move the
mouse, not just once as you move over the control.
 
B

Brandon

Thanks Rick,

I got the finger pointer working and my sanity has returned.

I have already tried the mouse move event and could not figure out a way to
get it to turn off... other than rolling back over the button, which defeats
the purpose.
 
R

Rick Brandt

Brandon said:
Thanks Rick,

I got the finger pointer working and my sanity has returned.

I have already tried the mouse move event and could not figure out a
way to get it to turn off... other than rolling back over the button,
which defeats the purpose.

Yeah, I find the MouseMove event pretty useless.
 
B

BeWyched

Hi Rick

I'm slightly confused with your reply.

I use the Mousemove event to turn on the 'finger' which does seem to turn
itself off when the cursor leaves the Command button? I prefer this to
setting the property through the Button's property sheet as it prevents the
Button caption changing colour and becoming underlined.

In the 'On Mouse Event' I use:

Me.Command0.HyperlinkSubAddress = " "

Cheers.

BW
 
H

Harry

Thanks for the solution as I became a little crazy too.
However within my db I want to change the mouse pointer on all forms to
change as the pointer moves over all buttons on a form.
Any idea how to do this?

Harry
 
R

Rick Brandt

BeWyched said:
Hi Rick

I'm slightly confused with your reply.

I use the Mousemove event to turn on the 'finger' which does seem to
turn itself off when the cursor leaves the Command button?

The reason it "appears" to turn itself off is that you are setting a
property that only has an effect when the mouse is over the button. Rest
assured that if you don't have code somewhere else changing the setting back
that it is "sticking" until the form is closed.
I prefer
this to setting the property through the Button's property sheet as
it prevents the Button caption changing colour and becoming
underlined.

If you explicitly set the font color and style then you dont; get Blue and
Underlined captions on the buttons.
In the 'On Mouse Event' I use:

Me.Command0.HyperlinkSubAddress = " "

No reason at all to just not set that once in design view and forget about
it.
 
B

BeWyched

Use

Screen.MousePointer = 0

in the Form's Page Details Mouse Move Event:

This will return the pointer to the Windows default whenever you leave the
Command button/s.

Cheers.

BW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top