给我元气:c#的问题
来源:百度文库 编辑:高校问答 时间:2024/05/08 13:31:51
在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);
}
中添加这个就可以了。