On mouse move repeat only once

  • Thread starter rigor via AccessMonster.com
  • Start date
R

rigor via AccessMonster.com

I am set command button on mouse move event to open some form with on timer
event. But if mouse pointer standing on command button without moving, on
mouse move event is repeating. How to set event to repeat only once when
mouse pointer move trought command button?

Thanks for advance,
Gepetto
 
D

Dale Fye

The purpose of a command button is to perform some function, usually in the
buttons click event. Are you trying to achieve this same functionality, but
with the mouse over event?

Not understanding why you want to do this, the way I would approach it is to
create a public variable to store some status (bEnableMouseOver). You might
also need a variable to store the time (I'd make this a variant so you can
store a Null or Timer value) when you first mouseover the button, if you
don't want to fire the event until . I would set it bEnableMouseOver to True
when the form loads. Then, when you mouse over the control, I would check to
see whether this value is true or false. If false, the form is already open.
If true, I would check to see if the timer variable is NULL. If so, I would
set it. If it is not null, I would check to see whether the difference
between the current Timer() function and the varTimer variable is greater
than the time you want to evaluate. If it is, I'd set bEnableMouseOver to
false, and open the form.

The thing about this is that if you do this, then you also have to put some
code in the forms mouseover control, so that you can reset varTimer and
bEnableMouseOver whenever the cursor moves off of the command buttons.

Seems like a lot of work to enable a functionality that already exists with
a click. Besides, what if your user bumps the mouse and accidentally moves
the cursor over the control?
--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.
 

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