VCL.Switch Sample

From RAD Studio Code Examples
Jump to: navigation, search

Language:

This sample demonstrates how to change event handlers at run time.

Contents

Location

You can find the switch sample project at:

Description

The application creates a simple form with one button. The handler for the TButton.OnClick event changes at run time every time the button is clicked.

How to Use the Sample

  1. Navigate to Start > Programs > Embarcadero RAD Studio > Samples and open scrollba.cbproj.
  2. Press F9 or choose Run > Run.

Files

The project contains one source file, main.pas, which contains the main form class.

Classes

TFormMain, the class corresponding to the main form, handles the events that occur when interacting with the visual components on the form.

Implementation

A message box is prompted to let the user know which handler is being executed.

Uses

Personal tools