Command Button Rollovers

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
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.
 
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.
 
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
 
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
 
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.
 
Harry said:
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?

You'd have to apply that HyperLinkSubAddress property setting to all of
them. There might be a way to automate that, but I have never automated
design changes like that.

It really goes against Windows widget and interface conventions to do this
anyway. Surely your users know what buttons do. The "pointing finger" on
hyperlinks was adopted as a convention specifically for use on objects where
clicking on them was NOT an obvious thing.
 
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
 
Back
Top