philtwo
asked on
How to determin which component triggered an event?
I am working on my first windows project in Borland C++ and I can't seem to figure this out:
I need to have an array of components, or some way of quickly stepping through each one so I can duplicate the values, I chose an array.
I define my componenets:
TCheckBox ListBox[MAX_ITEMS];
for (count=0;count<MAX_ITEMS;c ount++) {
ListBox[count] = new TCheckBox(this);
ListBox[count].Top = 35;
ListBox[count].Tag = count;
// other properties and stuff ...
ListBox[count].OnClick = &EntryDuplicate;
}
My question is how can I access the properties of the
TCheckBox componenet that triggered the event from the event?
Thanks in advance.
I need to have an array of components, or some way of quickly stepping through each one so I can duplicate the values, I chose an array.
I define my componenets:
TCheckBox ListBox[MAX_ITEMS];
for (count=0;count<MAX_ITEMS;c
ListBox[count] = new TCheckBox(this);
ListBox[count].Top = 35;
ListBox[count].Tag = count;
// other properties and stuff ...
ListBox[count].OnClick = &EntryDuplicate;
}
My question is how can I access the properties of the
TCheckBox componenet that triggered the event from the event?
Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Asbolute life saver - thanks alot!!
void __fastcall TForm1::EntryDuplicate(TOb
{
TListBox *listbox = dynamic_cast<TListBox*>( Sender );
if( listbox != NULL )
{
listbox->Top = 10;
//....
}
}