Beruflich Dokumente
Kultur Dokumente
In the next few pages, you're going to create a Calculator. It won't be a very
sophisticated calculator, and the only thing it can do is add up. What the project will give
you is more confidence in using variables, and shifting values from one control to
another. So create a new project, call it Calculator, and let's get started.
Equals Button
Name: btnEquals
Font MS Sans Serif, Bold, 14
Text: =
Clear Button
Name: btnClear
Font MS Sans Serif, Bold, 14
Text: Clear
When your form design is finished, it might look something like this:
So if you wanted to add 5 + 9, you would click first on the 5. A 5 would appear in the
textbox. Then you would click the + symbol. The 5 would disappear from the textbox.
Next, click on the 9. The number 9 would appear in the textbox. Finally, click on the =
symbol. The 9 would disappear from the textbox, and the answer to our sum would
replace it. We would then click the Clear button to clear the display.