Property ALIGN of a component
In this column, we have a detailed look at the property Align of visual components such as panels, memo's, grids and so on.
A panel aligned to the top of a form is often used as a "toolbar" with various components on it, such as speedbuttons. A panel aligned to the bottom is often used to contain a "status bar".Note: don't confuse Align with "Alignment", that determines how text is aligned (left, center, right).
The form was resized.
Original dimensions of the form.
Possible values for Align
Code example: create aligned panels at runtime
var Panel1, Panel2: TPanel; procedure TForm1.FormCreate(Sender: TObject); begin // Create a new panel and align it to the top of Form1 Panel1 := TPanel.Create(Self); Panel1.Parent := Self; Panel1.Align := alTop; Panel1.Height := (ClientHeight div 4); Panel1.Caption:= 'Panel1'; // Create a new panel and align it to the remaining client size Panel2 := TPanel.Create(Self); Panel2.Parent := Self; Panel2.Align := alClient; Panel2.Caption:= 'Panel2'; end;
In the example above, Self stands for Form1. Thus, Form1 becomes the parent of the two panels.
© Copyright 1999-2019