Three State Buttons

G

Guest

I'm creating 3 Images to use as a button in my Form (up/hit/down). I'm using
MouseOver and MouseUp to determine the over and hit states which also changes
the image appropriately. My problem is that I can't figure out how to tell
if the Mouse is no longer over the image to redisplay the button up image.
Can somebody help me out?
 
D

Dirk Goldgar

The Flash said:
I'm creating 3 Images to use as a button in my Form (up/hit/down).
I'm using MouseOver and MouseUp to determine the over and hit states
which also changes the image appropriately. My problem is that I
can't figure out how to tell if the Mouse is no longer over the image
to redisplay the button up image. Can somebody help me out?

Use the MouseMove event of either (a) the section of the form the button
is on, or else (b) a background control such as a box that you put
*behind* the button, extending well past the button in all dimensions.

Note that this can be a bit tricky, as you have to make sure there's
enough of the resetting background (section or control) exposed around
the button to be sure its MouseMove event will fire even if the user
moves the mouse quickly.
 
G

Guest

I see what you mean, but it works. But is there a way I can code my own
MouseOver function in VBA to return state of a control and so forth.
 
D

Dirk Goldgar

The Flash said:
I see what you mean, but it works. But is there a way I can code my
own MouseOver function in VBA to return state of a control and so
forth.

I don't understand the question. Would you care to elaborate?
 
G

Guest

Create a Function that can detect mouse movement and give the status of it's
X/Y and clicks.
 
D

Dirk Goldgar

The Flash said:
Create a Function that can detect mouse movement and give the status
of it's X/Y and clicks.

Unless you want to do the complex API programming that Access itself
does, I think you have to use the MouseMove, Click, MouseDown, and
MouseUp events. You could probably write a single function,
"MouseActivity" that you could call from all the relevant events, but
you'd have to write event procedures for all those events, to pass the
arguments from the event procedure to your function.
 

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