发生变化会驱动text_change事件

解决方案 »

  1.   

    保存到一个变量里面 onchange的时候比较就可以了
      

  2.   

    public static bool textchanged=false;
    private void textBox1_TextChanged(object sender, System.EventArgs e)
    {
    textchanged=true;
    }
      

  3.   

    <input onpropertychange="alert()">也可以
      

  4.   

    蜘蛛侠说得很对!
    就那样!
    你要是直接从工具箱里拖过来的TextBox就可以直接单击它的TextChanged()事件,在它里面添加相应代码!你要是动态添加的TextBox,就是用程序添加的,那就得在添加控件时同时把TextChanged()事件也添加上去!比如:
    TextBox txt = new TextBox();
    txt.TextChanged += new System.EventHandler(this.txt_textchanged);
    txt_textchanged是你自己编写的函数,就是txt触发TextChanged事件时所要执行的代码!