我动态地添加按钮。 Button newButton = new Button(); 现在我想让每个按钮都被触发。所以我给他们写了下面的事件:添加按钮事件!
public void response_Click(object sender, EventArgs e)
{
}
public void edit_Click(object sender, EventArgs e)
{
}
public void quote_Click(object sender, EventArgs e)
{
}
Button quote = new Button();
Button reply = new Button();
Button edit = new Button();
quote.ID = "quote";
reply.ID = "reply";
edit.ID = "edit";
我怎么触发他们,只要用户点击按钮..将我的上述功能触发?我需要执行以下操作:
this.Clicked + = quote; this.Clicked + =回复; this.Clicked + = edit;
如果我确实需要这样做..我在哪里放这些代码行?
我使用Visual Studio 1010 asp.net
或者直接引用.Click + = quote_Click等 – phoog 2011-05-13 06:01:42
ooo谢谢!!! – 2011-05-13 06:28:31