Table of Contents

Text, Images, and Commands

TTMSFNCButton is a command button with FNC bitmap and HTML text support. Use it when a plain framework button is not enough for the visual language of the form.

Configure Text and Click Handling

Set Text and handle OnClick as with a regular button. The control also exposes FNC text layout and word-wrapping options.

procedure TForm1.ConfigureButton;
begin
  TMSFNCButton1.Text := 'Refresh';
  TMSFNCButton1.OnClick := TMSFNCButton1Click;
end;

procedure TForm1.TMSFNCButton1Click(Sender: TObject);
begin
  ShowMessage('Refresh requested.');
end;

Add Bitmap Content

Assign a BitmapContainer and BitmapName when the image is shared with other controls. Set ShowImage to display it and use image/text alignment properties to tune layout.

procedure TForm1.ConfigureImageButton;
begin
  TMSFNCButton1.BitmapContainer := TMSFNCBitmapContainer1;
  TMSFNCButton1.BitmapName := 'refresh';
  TMSFNCButton1.ShowImage := True;
  TMSFNCButton1.BitmapSize := 20;
  TMSFNCButton1.Text := '<b>Refresh</b>';
end;

Combining rich text, bitmap content, and click handling

HTML-capable text and bitmap content can be used together when a command needs both an icon and formatted label:

procedure TForm1.FormCreate(Sender: TObject);
begin
  TMSFNCButton1.BitmapContainer := BitmapContainer1;
  TMSFNCButton1.BitmapName      := 'save';
  TMSFNCButton1.ShowImage       := True;
  TMSFNCButton1.ImageLayout     := bilLeft;
  // HTML label with bold shortcut hint
  TMSFNCButton1.Text := '<b>Save</b> <font color="#888888">Ctrl+S</font>';
  TMSFNCButton1.WordWrapping := False;
end;

procedure TForm1.TMSFNCButton1Click(Sender: TObject);
begin
  SaveDocument;
end;