PlainTextProperty (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example requires two TRichEdit controls on the form. When the form becomes visible, the first Rich Edit control displays the rich text in its raw form, including formatting characters. The second shows the rich text in its intended format.

Code

procedure TForm1.FormCreate(Sender: TObject);
const
  // You may need to change this path to suit your environment.
  Path = 'OverView.RTF';
begin
  RichEdit1.PlainText := True;
  RichEdit1.Lines.LoadFromFile(Path);
  RichEdit1.ScrollBars := ssVertical;
  RichEdit2.PlainText := False;
  RichEdit2.Lines.LoadFromFile(Path);
  RichEdit2.ScrollBars := ssVertical;
end;

Uses