hub.eb?material_id=127

Fields and events


In this tutorial we will create a very basic calculator app. 

Steps


1

Create a new form and call it myCalculator.

2

Add a panel and give it a Horizontal layout, then add three numeric fields using the Fields Wizard  and label them F1F2 and F3.

3

Add an equals sign to the third field label and make it Display only in the Properties. Add a button between the second and third fields and label it ADD.

4

Create a new script called calculate, and add the following script:

fields.F3.value = fields.F1.value + fields.F2.value;

This script will simply add the values of F1 and F2 and enter the result into F3

Add the script to the button's On Click event.

5

Run your form, enter values into F1 and F2 and click ADD. The result will appear in F3.

Related