崩坏2雷灵:c#的问题

来源:百度文库 编辑:高考问答 时间:2024/04/29 08:40: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);

}
中添加这个就可以了。