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

William Benson (VBACreations.Com) vbacreations at gmail.com
Wed Jul 6 11:47:02 CDT 2011


OK, I am scratching my head to think why I didn't see this simpler solution
the minute A.D. showed me how to test X and Y. This pretty much always
resets at the button edge, and if shift is held, shows the alternate caption
in the interior. 

Private Sub cmdClearFieldHistory_MouseMove(Button As Integer, Shift As
Integer, X As Single, Y As Single)
Dim W As Single
Dim H As Single

If Shift = 0 Then
    cmdClearFieldHistory.Caption = "Clear Field History"
Else
  W = cmdClearFieldHistory.Width
  H = cmdClearFieldHistory.Height
  If X = 0 Or X = W Or Y = 0 Or Y = H Then
    cmdClearFieldHistory.Caption = "Clear Field History"
  Else
    cmdClearFieldHistory.Caption = "Clear All Fields"
  End If
End If
End Sub





More information about the AccessD mailing list