> How to work out the sum of 3 text boxes?

How to work out the sum of 3 text boxes?

Posted at: 2014-12-18 
What language? Usually you'd just call a get method for each box, add them together, and then use a set method for the last box. For example, Java syntax might look like "sum = (int)Txt1.getText() + (int)Txt2.getText() + (int)Txt3.getText();" and "Txt4.setTxt(sum);". How these methods work and if they exist depends on the language and what program or library is providing the boxes. Just make sure you convert from a string to a number type before you add and that when you put the sum in a textbox, it ends up as a string (it may or may not need conversion).

So lets say I have 3 text boxes and they contain numbers in them. For example:

Txt1= 2

Txt2 = 5

and Txt3 = 6

Then I have another text box which adds them up when I press a button. How do I do that?