We are using a TextBox to display input received from the I/O system. If the user enters some data on the text box, the value will be written to the IO system.
We are using the OnTextChanged event to write the data entered by the user to the IO system.
The problem is that we get this event when we update the value received from the IO system to the text box (from the code).
Is it possible to know whether the value of the TextBox is changed by the user or by using the code?
You could set a Boolean variable named IsUserInput, after the I/O system sends data to the text box, you need to set IsUserInput to false. In the
KeyDownevent of the TextBox, the variable can be set to true. Finally, you could use this variable to determine the text inputter in thetextChangedevent.Please refer to the following code.