Solved

Sender Name in onClick Event

Posted on 2007-04-10
5
225 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 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

21 Experts available now in Live!

Get 1:1 Help Now