Local Methods
You can add local methods to form objects, including buttons, menu items, and events. Local methods do not have nodes displayed under the Methods node in the application tree. In the method window for a local method, its tab displays the path to its associated user interface component, as shown in the figure below for the case of a checkbox object.
In the Form Editor, you can right-click a form object and select Create Local Method from a menu, as shown in the figure below.
Local Methods for Buttons, Menu Items, and Global Events
For buttons, ribbons, menus, toolbar items, and global events, you can add a local method by selecting Convert to Local Method from the toolbar menu button under the sequence of commands, as shown in the figure below.
The function of this button is similar to the Convert to Method and Convert to Form Method buttons, described in the section Creating a New Method. The only difference is that it creates a local method not visible in the global method list in the application tree. It also opens the new method in the Method Editor after creating it. Ctrl+Alt+Click can be used as a shortcut for creating the local method. Clicking the button Go to Method will open the local method. The figure below shows a call to a local method associated with a button.
To avoid any risk of corrupting code in a local method, you are unable to use Convert to Method when there is a local method present in the command sequence.
Local Methods for Form and Form Object Events
To add a local method for a form or form object event, select the Create Local Method option in the Events section of the Settings window. The selected On data change method changes from None to Local method, as shown in the figure below, and the Method Editor is opened.
To open an existing local method in the Method Editor, click the Go to Source button. To delete the local method, select Remove Local Method from the menu.
As an alternative to Ctrl+Alt+Click, you can right-click a form object and select Edit Method from its context menu.
For more information, see Events.