.net 在复选框的CheckChanged事件中使用e作为System.EventArgs
请告诉我如何使用参数e作为系统。在CheckChanged事件中,CheckBox的event args没有任何用处 从文件中:.net 在复选框的CheckChanged事件中使用e作为System.EventArgs,.net,winforms,.net,Winforms,请告诉我如何使用参数e作为系统。在CheckChanged事件中,CheckBox的event args没有任何用处 从文件中: 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,
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.
你可以忽略这个 所有事件都具有相同的签名:
void处理程序(对象发送者,XxxEventArgs e)
某些事件具有更多信息,并使用从System.EventArgs派生的类作为第二个参数
例如:
private void MainForm_KeyPress(object sender, KeyPressEventArgs e)
{
char ch = e.KeyChar;
....
}
正如其他人所说,它只是为了有一个匹配所有UI事件的签名 它是(对象发送方、事件args(或任何派生)args)