LabeledEdit (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This code demostrates how to configure a TLabeledEdit at run time. A TLabeledEdit is assumed to be placed on the form.

Code

procedure TMainForm.FormCreate(Sender: TObject);
var
  EditLbl: TBoundLabel;
begin
  { Retrieve the label associated with the edit control. }
  EditLbl := edtName.EditLabel;

  { Configure the label. }
  EditLbl.Caption := 'Specify the name:';
  EditLbl.Font.Color := clBlue;

  { Set the label position and spacing relative to
    the edit control. }
  edtName.LabelPosition := lpAbove;
  edtName.LabelSpacing := 2;
end;

Uses

Personal tools
Assistance