I
Ian Ornstein
I am coding a windows form. The form has several labels and I hoped to use
one click event because the processing to be done is very similar.
I just tried this:
void lblDayNoClick(object sender, System.EventArgs e)
{
MessageBox.Show(sender.ToString() );
}
and the result displayed in the MsgBox was
System.Windows.Form.Label, Text:13
How can I take the sender and determine the name of the object that
was clicked to cause this event?
I expect that since the actual object is sent, its properties should
be available.
If not, please suggest alternate approaches.
Thanks in advance,
- IanO -
one click event because the processing to be done is very similar.
I just tried this:
void lblDayNoClick(object sender, System.EventArgs e)
{
MessageBox.Show(sender.ToString() );
}
and the result displayed in the MsgBox was
System.Windows.Form.Label, Text:13
How can I take the sender and determine the name of the object that
was clicked to cause this event?
I expect that since the actual object is sent, its properties should
be available.
If not, please suggest alternate approaches.
Thanks in advance,
- IanO -