FirstIndent (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example requires only one form. A Rich Edit control is created on the form and aligned to take the entire client area of the form. A series of lines are written to the Rich Edit control's Lines property. The Paragraph property is also manipulated, such that the first items displayed are bulleted, a second group of lines are unbulleted and centered, and the last group is left-aligned and indented.

Code

uses ComCtrls;

procedure TForm1.FormCreate(Sender: TObject);
begin
  with TRichEdit.Create(Self) do
  begin
    Parent := Self;
    Align := alClient;
    Lines.Clear;
    // set numbering style
    Paragraph.Numbering := nsBullet;
    Lines.Add('Introduction');
    Lines.Add('New members to our team');
    Lines.Add('New Budget discussion');
    Lines.Add('Facilities');
    Lines.Add('Q & A');
    Paragraph.Numbering := nsNone;
    Paragraph.Alignment := taCenter;
    Lines.Add('');
    Lines.Add('Suggested Topics:');
    Lines.Add('');
    Paragraph.Alignment := taLeftJustify;
    Paragraph.FirstIndent := 10;
    Lines.Add('');
    Lines.Add('Parking lot repair');
    Lines.Add('Cost overruns');
  end;
end;

Uses