|
|
Refering to the Control which "called" a procedure/subQuestionIs there convenient code for returning the name of the control which was
clicked on when a procedure was started - when the "control" is a rectangle that
apparently cannot take the focus and will not therefore permit 'ActiveControl'?
(Access95 btw) Answer
Public Function ShpToggle(ByRef rfrm As Form, _
ByVal vstrCtlName As String, _
ByVal vblnDown As Boolean)
If vblnDown Then
rfrm(vstrCtlName).SpecialEffect = 2 'Sunken
Else
rfrm(vstrCtlName).SpecialEffect = 1 'Raised
Doevents
'*+
'
' Call the function(s) to process your "button" click
'
'*-
End If
End Function
and call it from OnMouseDown: =ShpToggle([Form];"shpCtlXName";True) OnMouseUp:
=ShpToggle([Form];"shpCtlXName";False) P.S. Modern soultion - use WithEvents feature. Copyright © 1999-2008 by Shamil Salakhetdinov. Original version is published here All rights reserved. |