Writng the programming code

Now it is time to write the code, which sums the numbers from the first two fields and shows the result in the third field. For the purpose we click twice the button [Calculate]. The place, in which we write what is going to happen by clicking the button will be shown:

We write the following C# code between the opening and the closing brackets { }, where the cursor is:

This code takes the first number from the field textBox1 and keeps it in the variable num1, keeps the second number from the field textBox2 in the vriable num2, afterwards it sums num1 and num2 in the variable sum and in the end takes the text value of the variable sum in the field textBoxSum.

results matching ""

    No results matching ""