Textbox value changed

后端 未结 5 1347
天命终不由人
天命终不由人 2020-12-07 03:08

Is it possible to know if any of the textbox values have changed in the application. I have around 30 textboxes and I want to run a part of code only if, any of the textbo

5条回答
  •  情书的邮戳
    2020-12-07 03:37

    This is perhaps on the rough and ready side, but I did it this way.

    In the constructor, I created

    bool bChanged = false;

    In the TextChanged event handler of each control (actually same for each), I put

    bChanged = true;

    When appropriate, I could do some processing, and set bChanged back to false.

提交回复
热议问题