Tour of a Small Application

The simple act of plopping a component such as a button onto a form causes code for that element to be generated and added to the form object:

type
  TForm1 = class(TForm)
    Button1: TButton;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

Now, as you can see, the button is an instance variable of the TForm1 class. When you refer to the button in contexts outside TForm1 later in your source code, you must remember to address it as part of the scope of TForm1 by saying Form1.Button1. Scoping is explained in more detail in Chapter 2.

When this button is selected in the Form Designer, you can change its behavior through the Object Inspector. Suppose that, at design time, you want to change the width ...

Get Borland® Delphi™ 6 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.