[AccessD] How to tell a button's "air space" is no longer beinghovered over

William Benson (VBACreations.Com) vbacreations at gmail.com
Mon Jul 4 10:23:28 CDT 2011


A.D.,

Other controls are too near the button's bottom and it's top edge is pretty
much as .Top = 0.

I have put the code in the other controls already, similar to what you
wrote.

I was wondering if there was a way like to test the mousemove if the
coordinates are exactly on bottom or top or at either side of the button,
based on X, Y, or whatever... and if so, the caption is treated as if the
mouse were outside it, and if not, use the caption that pertains to the
moust being inside. During a normal mousemove operation the user will be
headed out or headed into the interior of the button, so 

 -- if on the way out, the last code to execute will be to reset the caption
 -- if on the way in, the code executing (probably continuously) will be to
set the caption appropriate for interior of button

But I don't think it is possible to get the event to faithfully fire exactly
as the mouse is going over the edge of the button.

Thanks a lot,

Bill

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of A.D. Tejpal
Sent: Monday, July 04, 2011 10:23 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] How to tell a button's "air space" is no longer
beinghovered over

William,

    For detecting whether the mouse pointer has moved away from the control
in question, you can use the MouseMove event of form section to which the
said control belongs, for example:

' Code in form's module
'=============================
Private Sub Detail_MouseMove( _
                Button As Integer, Shift As Integer,  _
                X As Single, Y As Single)

    ' <<Your Code>>

End Sub
'--------------------------------------------

Private Sub FormFooter_MouseMove( _
                Button As Integer, Shift As Integer,  _
                X As Single, Y As Single)

    ' <<Your Code>>

End Sub
'--------------------------------------------

Private Sub FormHeader_MouseMove( _
                Button As Integer, Shift As Integer,  _
                X As Single, Y As Single)

    ' <<Your Code>>

End Sub
'=============================

Best wishes,
A.D. Tejpal
------------

  ----- Original Message ----- 
  From: William Benson (VBACreations.Com) 
  To: 'Access Developers discussion and problem solving' 
  Sent: Sunday, July 03, 2011 01:23
  Subject: [AccessD] How to tell a button's "air space" is no longer
beinghovered over


  I have some code which changes the caption of a button when the user has
the
  ctrl key pressed, set during the mousemove event for the button.

  I want however, that when the user leaves the "air space" for the button,
  then the caption reverts - regardless whether they still have shift held.

  I know I can use use the mousemove event associated with all surrounding
  controls to reset it, but I would like something more related to the
control
  itself. 

  Is there a method of testing that the user has moved the mouse outside the
  button's air space? 

  I have a feeling I am going to be out of luck...
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list