Writing Event Handlers

From Appmethod Topics
Jump to: navigation, search

Go Up to How To Create Forms and Projects, and Write the Code Behind

Your source code usually responds to events that might occur to a component at run time, such as a user clicking a button or choosing a menu command. The code that responds to an occurrence is called an event handler. The event handler code can modify property values and call methods.

To write an event handler

  1. On your form, click the component for which you want to write an event handler.
  2. To create the default event for the component, double-click the component on the form.
    To choose another event for the component, click the Events tab in the Object Inspector, locate the event, and double-click its text box. The Code Editor appears.
  3. Type the code that will execute when the event occurs at run time.

See Also