Skip to main content
Table of Contents

Getting Started with TMS FNC Chat

TTMSFNCChat is a chat UI control built on TTMSFNCTableView. It supports text messages, images, file attachments, timestamps, pull-to-refresh, and a customisable send button.

Prerequisites

  • Delphi with TMS FNC UI Pack installed.
  • A VCL, FMX, or WEB application.

Steps

1. Drop the component

Drop a TTMSFNCChat onto a form.

2. Enable the message field

Inline example 1PascalC++
TMSFNCChat1.ShowMessageField := True;
TMSFNCChat1->ShowMessageField = True;

This shows a text input and send button at the bottom. Users can type and press Enter or click Send.

3. Add messages in code

Inline example 2PascalC++
TMSFNCChat1.AddMessage('Hello!', cmlRight);
TMSFNCChat1.AddMessage('Hi there!', 'Alice', cmlLeft);
TMSFNCChat1->AddMessage("Hello!", cmlRight);
TMSFNCChat1->AddMessage("Hi there!", "Alice", cmlLeft);

4. React to sent messages

Inline example 3PascalC++
procedure TForm1.TMSFNCChat1AfterSendMessage(Sender: TObject;
  AText: string);
begin
  // AText contains the message that was just sent
end;
void __fastcall TForm1::TMSFNCChat1AfterSendMessage(TObject *Sender,
  TTMSFNCChatItem *&AItem)
{
  // AItem is the message item that was just sent.
}

Next steps