Trigger an action from a button click event
This exercise describes how to use a Click event to trigger an action when the button on a form is pressed.
To trigger an action on the click of a button:
- Select the button and then open the Events page in the Properties pane:
- Double-click on the Click event to open the Scripts panel.
- When you Save your changes and Run the form:
Events define the interaction between the user and a control. The mouse can be used, for example, to click a button or give focus to a button. Scripts can be associated with an event to trigger other events or actions.
In this simple example, the Click event is used to increase the font size of a label in the form:
Clicking on the Increase Font Size button will trigger the action defined by the script, increasing the font size of the label above it by 2 points: