If you add a widget to your form that can trigger an action, such as a Button, you can associate an action from the generated program to the widget.
Figure 1. Add Button