Getting started
Requirements
- Delphi 10.1 Berlin or later
- TMS FNC Core (required dependency)
- TMS FNC UI Pack
Drop the component
- Drop a
TTMSFNCRichEditoronto a form. - Optionally drop a
TTMSFNCRichEditorToolBarand set itsRichEditorproperty to the editor. - Arrange the toolbar above or below the editor using
Align.
Basic usage
// Set initial content
RichEditor1.Text := 'Hello, world!';
// Select all and apply bold
RichEditor1.SelectAll;
RichEditor1.Bold := True;
// Insert formatted text at cursor
RichEditor1.InsertText('Important: ');
Connecting the toolbar
RichEditorToolBar1.RichEditor := RichEditor1;
The toolbar automatically enables and disables its buttons based on the current selection.
HTML import and export
var IO: TTMSFNCRichEditorIO;
begin
IO := TTMSFNCRichEditorIO.Create(nil);
try
// Load HTML
IO.RichEditor := RichEditor1;
IO.LoadFromFile('document.html');
// Save HTML
IO.SaveToFile('output.html');
finally
IO.Free;
end;
end;
Next steps
- Editing and formatting — apply formatting programmatically
- Images and links — embed images and insert hyperlinks
- Import and export — HTML, PDF, and print
- Toolbar — connect and customize the toolbar