public class ArgButton:Button
{
public delegate void OnArgClick(btnEventArgs e);
public event OnArgClick ArgClick;
private string Args
{
get;
set;
}
public ArgButton()
{ }
public ArgButton(string args)
{
this.Args = args;
this.Click += new EventHandler(ArgButton_Click);
}
void ArgButton_Click(object sender, EventArgs e)
{
if (ArgClick != null)
{
ArgClick(new btnEventArgs(Args));
}
}
}
public class btnEventArgs:EventArgs
{
private string args;
public btnEventArgs(string args)
{
this.args = args;
}
public string Args
{
get { return this.args; }
}
}