self referencing of controls

  • Thread starter Thread starter m.h.dashper
  • Start date Start date
M

m.h.dashper

How can an event method (eg On Click) determine the name of the
control to which it belongs? In other words, is there a 'self' type
of property or other suitable mechanism?

Martin Dashper
 
No, there is no suitable way to identify this.

If the control was actually clicked or typed into, it will be:
Screen.ActiveControl
 
I am not sure I follow your question. The Click Event happens for a
particular Control the user clicks and, in fact, you write the Event
Procedure/Sub "ParticularControl_Click()" so you know the name of the
[ParticularControl].

Since the Control is clicked, it has the Focus, i.e. it is active, so you
can also refer to it using Screen.ActiveControl.
 
Back
Top