Ok, I am looking for the code to sum numbers from multiple boxes (2 in this case) and automatically fill another box with the sum without clicking a button or anything. I’m talking about displaying the sum in the third box while numbers are being inputted into the first two boxes. Is this possible? If so, how?
Share
You can subscribe to the TextBox TextChanged events, and update the third text box when the text in either of the first two changes.
Just make sure you handle invalid input carefully (ie: use
Int32.TryParseinstead ofInt32.Parse), as exceptions will likely be raised as the text box values aren’t numbers.