Code For On Mouse Move Event

J

JamesJ

Access 2007 sp2.

I've changed from command buttons to labels for certain aspects of my db.

I want to use the on mouse move event over the labels to trigger some visual
indication that one's mouse pointer is over the label and then have it return
to normal when the pointer leaves the label. Like when moving over a command button.

I used to have code for this but I was unable to find it again on the web.

Any help will be appreciated,
James
 
D

Daryl S

James -

Moving a mouse over a label that is attached to a control is the same as
moving the mouse over the control, so you would use the control's mouse over
event. If you really want a different event for the label than for the
control, then delete the attached label and replace it with a free-standing
label. Then you can test for the mouse over event on just the label.
 
J

JamesJ

That's exactly what I have, free standing labels.
I have no controls for the labels. I added the labels using the label button
on the Ribbon.
Labels which I'm using in place of command buttons.
I already have an event on these labels to change the mouse pointer to a
hyperlink hand when
the mouse pointer moves over them.
I want an event to change, for an example, the border style to 2 point and
back to 1 point
when the mouse pointer moves on and off the label.

James
 
D

Daryl S

James -

So you have the event working, do you just need the code to change the
border style? Try this:

Me.LabelControlName.BorderColor = vbRed
Me.LabelControlName = 1 'solid (transparent = 0)
 
J

JamesJ

Actually it's a bit more.
I have 12 labels. I want to change the appearance, whether it's the border
color,
forecolor or whatever, and back agian when I pass the mouse pointer over the
label.
Just like what one sees when one passesd the mouse pointer over a command
button.

James
 
J

JamesJ

I found some code for this if anyone is interested.
I was able to change a property of the label when I pass the pointer over using the Moise Move event
but didn't know how to change it back.
By changing the property back in the form's Detail On Mouse Move event for the labels I am able to change it back.
Only problem is whenever I move the mouse anywhere in the detail section the labels blink and it looks like hell.
I tried to apply the change back using a rectangle I placed behind the labels (similar to a navigation pain)
instead of the detail section but the same thing happens.

Access 2007 sp2.

I've changed from command buttons to labels for certain aspects of my db.

I want to use the on mouse move event over the labels to trigger some visual
indication that one's mouse pointer is over the label and then have it return
to normal when the pointer leaves the label. Like when moving over a command button.

I used to have code for this but I was unable to find it again on the web.

Any help will be appreciated,
James
 
J

JamesJ

I found it was much easier to use command buttons and set the backstyle to tranparent and stick
a rectangle behind the buttons.

I don't always talk to myself. But I do talk the my cat even though he gives me a dirty look and walks out of my way.

James

Access 2007 sp2.

I've changed from command buttons to labels for certain aspects of my db.

I want to use the on mouse move event over the labels to trigger some visual
indication that one's mouse pointer is over the label and then have it return
to normal when the pointer leaves the label. Like when moving over a command button.

I used to have code for this but I was unable to find it again on the web.

Any help will be appreciated,
James
 

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

Similar Threads


Top