self referencing of controls

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
 
A

Allen Browne

No, there is no suitable way to identify this.

If the control was actually clicked or typed into, it will be:
Screen.ActiveControl
 
V

Van T. Dinh

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.
 

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