薪火艺考:c#的问题

来源:百度文库 编辑:神马品牌网 时间:2024/05/09 01:57:52
在webform中怎样让TextBox的TextChanged事件起作用?

首先要写一个事件!
private void TextBox1_TextChanged(object sender, System.EventArgs e)
{
//你的代码!
}

然后在private void InitializeComponent()
{
this.TextBox1.TextChanged += new System.EventHandler(this.TextBox1_TextChanged);
this.Load += new System.EventHandler(this.Page_Load);

}
中添加这个就可以了。