using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; publicpartialclass _Default : System.Web.UI.Page ...{ protectedvoid Button1_Click(object sender, EventArgs e) ...{ Response.Write("这是Button1触发的事件"); } protectedvoid Button2_Click(object sender, EventArgs e) ...{ Button1_Click(null, System.EventArgs.Empty);//调用Button1单击事件 } } /**//* 下面是调用其他类型事件的例子(VB的),摘自CSDN 2 楼Snakeguo(Guoguo)回复于 procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); begin showmessage('enter'); end; procedure TForm1.Button2Click(Sender: TObject); var k: char; begin k := 'a'; Edit1KeyPress(Sender, k); end; */