?
Solved

Sender Name in onClick Event

Posted on 2007-04-10
5
Medium Priority
?
236 Views
Last Modified: 2010-04-05
I have an onClick event that several components use.  One of them is causing a problem, but I can't tell how to figure out which one is the problem.

I can't do  ShowMessage(Sender.name) inside the onClick event.

How can I tell the name of the component?

Thanks,
0
Comment
Question by:light_bulb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 5

Expert Comment

by:xr1140
ID: 18883745

you could use someting like :

CodeSite  > http://www.raize.com/DevTools/CodeSite/Default.asp

or

SmartInspect > http://www.gurock.com/products/smartinspect/
0
 
LVL 3

Author Comment

by:light_bulb
ID: 18883783
Is there no way to do it in Delphi without have to install/buy 3rd party utils?
0
 
LVL 5

Accepted Solution

by:
xr1140 earned 2000 total points
ID: 18883844

  ShowMessage( (Sender as _component_type_ ).Name );

change  _component_type_  with your specific component
0
 
LVL 3

Author Comment

by:light_bulb
ID: 18884013
I did the following, since I have several different types of components, but you led me in the right direction:

ShowMessage((Sender as TControl).Name);
0
 
LVL 5

Expert Comment

by:xr1140
ID: 18884138

i`m glad i could help you :D
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question