Solved

Sender Name in onClick Event

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

785 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