Mouse over actions

:cool:
Thanks ChrisO, thanks works a treat. I don't exactly understand most of it but I'm trying.....

I managed to add a little If...Then so the last option button comes up with a different colour which was another thing I really wanted.

Cheers mate!

dh
 
Your welcome Darrell

If you want different colours for the Labels try storing those colours in the Labels Tag property.

Change this line: -

Me(strHighlightedLabel).ForeColor = conHighlight

To this;

Me(strHighlightedLabel).ForeColor = Val(Me(strHighlightedLabel).Tag)

That will get rid of any ‘If’ statements.

Regards
Chris
 
Ooooh cunning.

Thanks ChrisO, that makes for two things I've learnt today already....

dh
 
Simple inelegant solution to mouse 'off'

Came across this thread whilst searching for 'mouse over' problems that I have. I have since solved it using something not elegant, but simple, and thought I'd share it in case others are trying to do the same thing.

Problem: I wanted to have a label that I can click like a button
Solution: Simple 'on-click' event, no problem.

Problem2: I wanted that label's writing to change to red whilst 'mouse over', then go back to white after 'mouse off'.

My solution (I'm no good at coding, so this is an idiots solution):
On the label, a simple macro for the 'mouse over' event to turn the forecolor red.
Underlay that label with a box, slightly larger than the label. On that box's 'mouse over' event, install a macro that writes the label's forecolor to white. Hence, every time the mouse heads to or from the label, it returns the colour to white.

Not elegant, but it works! And you don't need to be a coding genius :D
 
gussy,

It is not that hard to code the label changes that you want. Look at the funwithbuttons.zip sample I posted near the beginning of this thread to see how I did it.

HTH
 
Why on mouseover action is not listed?

well, i saw chris's work. that's fantastic. But my question is whether "on mouseover" action is not available in ms access2000 or i failed to find it??
 
G’day abdbuet and welcome to the site.

Check for On Mouse Move.

Remember that if labels are attached to controls they do not have events.

Regards,
Chris.
 
The attached demo employs a fair bit more code but reduces Event processing dramatically.
There is also a counter to show the number of calls to the common MouseMove Event.

Edit to add:
The idea of storing the last highlighted Label came from Timbuck2 at Utter Access.
Regards
Chris

Outstanding. Took a bit of "tailoring" to integrate into my form, but in the end it works beautifully... thanks a bunch.

Referenced you and Timbuck2 as source of code ;)
 

Users who are viewing this thread

Back
Top Bottom