please tell me the use of parameter e as System.EventArgs in CheckChanged event of CheckBox
+3
A:
System.EventArgs has no use.
From the documentation:
This class contains no event data; it is used by events that do not
pass state information to an event handler when an event is raised.
If the event handler requires state information, the application
must derive a class from this class to hold the data.
Sofahamster
2010-03-03 17:14:01
Thanks mr. Sofahamster
Tejas
2010-03-03 17:21:16
+2
A:
You can ignore this one.
All events have the same signature: void handler(object sender, XxxEventArgs e)
Some events have more information and use a class derived from System.EventArgs for the second parameter.
For instance:
private void MainForm_KeyPress(object sender, KeyPressEventArgs e)
{
char ch = e.KeyChar;
....
}
Henk Holterman
2010-03-03 17:14:49
A:
As other have stated it's just there in order to have a signature that match all UI events.
which is (object sender, EventArgs (Or any derivative) args)
NPayette
2010-03-03 17:53:03