StdCtrlsProp (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example demonstrates the use of some properties available for TButton, TCustomComboBox, TCustomEdit, TLabel and TMemo objects.

Code

procedure TMainForm.btProcessClick(Sender: TObject);
begin
  Memo1.Lines.Clear;
  if (SecondaryForm.ShowModal = mrOk) then
    Memo1.Lines.Add('Your information has been processed.');
  if cmbGender.ItemIndex = 0 then
    Memo1.Lines.Add('Male')
  else
    Memo1.Lines.Add('Female');
  Memo1.Lines.Add(edAge.Text);
end;

procedure TMainForm.edAgeChange(Sender: TObject);
begin
  edAge.Color := clHotLight;
  btProcess.Enabled := True;
end;

procedure TMainForm.FormCreate(Sender: TObject);
begin
  cmbGender.TextHint := 'Select your gender';
  edAge.Alignment := taCenter;
  edAge.NumbersOnly := True;
  edAge.MaxLength := 2;
  btProcess.Enabled := False;
  Memo1.CharCase := ecUpperCase;
  lblGender.GlowSize := 5;
  edInsAge.SetSelText('Age:');
  edInsAge.Enabled := False;
end;

Uses