TCustomEditAutoSize (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example uses an edit box and a button on a form. When you click the button, the font in the edit box enlarges, and the edit box enlarges also to accommodate the larger font size.

Code

procedure TForm1.Button1Click(Sender: TObject);
begin
  Edit1.AutoSize := True;
  Edit1.Font.Size := 20;
  Edit1.Text := 'The edit box is taller now';
end;

Uses