Solved

Sender Name in onClick Event

Posted on 2007-04-10
5
224 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
  • 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 500 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now