Hi
I am trying to understand when sender is useful.In what circumstances i need this?
I have a sample code :
Code:
void __fastcall TForm1::Button1Click(TObect *Sender)
{
TButton *Button = dynamic_cast<TButton *>(Sender);
if (Button)
{
// do something if a button was pressed.
}
else
{
// do something when a call was made
// passing a NULL value for *Sender)
}
}
here it writes :
// do something when a call was made
// passing a NULL value for *Sender)
How can it possible?I mean what type of code passing NULL value for *Sender.I am confused.
Please help me to understand the functionality of sender.
Thanks.