PlainText (C++)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example requires two TRichEdit controls placed 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 one shows the rich text in its intended format.

Code

__fastcall TForm1::TForm1(TComponent* Owner)
  : TForm(Owner)
{
// You may need to change this path to suit your environment.
  wchar_t const *Path = L"..\\overview.RTF";
  RichEdit1->PlainText = true;
  RichEdit1->Lines->LoadFromFile(Path);
  RichEdit2->PlainText = false;
  RichEdit2->Lines->LoadFromFile(Path);
}

Uses