如何添加事件参数?如果我在 System.EventHandler( , ) 中添加,我会收到错误消息。
class RadioButtonChecked: EventArgs
{
private int m_ButtonNumber;
public RadioButtonChecked(int num)
{
m_ButtonNumber = num;
}
public int ButtonNumber
{
get { return m_ButtonNumber; }
}
}
this.radioButton1.Click += new System.EventHandler(this.radioButton_CheckedChanged);
this.radioButton2.Click += new System.EventHandler(this.radioButton_CheckedChanged);
private void radioButton_CheckedChanged(object sender, RadioButtonChecked e)
{
//do something...
}