Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To load RTF text from a database into TRichEdit, follow these steps:

  1. Connect to the database and retrieve the RTF text as a string.
  2. Assign the string value to the TRichEdit's Text property.
  3. Set the TRichEdit's PlainText property to False to enable RTF formatting.

Here's an example code snippet:

var
  rtfStr: string;
begin
  // connect to the database and retrieve the RTF text
  rtfStr := MyQuery.FieldByName('RTFText').AsString;

  // assign the text to the TRichEdit and enable RTF formatting
  MyRichEdit.Text := rtfStr;
  MyRichEdit.PlainText := False;
end;