← Back to Index

TFlexFMXAdvancedButton

A powerful button component with Bootstrap-style variants, icon support, HTML text rendering, badge notifications, and comprehensive styling options.

Overview

TFlexFMXAdvancedButton extends the standard FMX button with:

Key Properties

ButtonStyle: TFlexFMXButtonStyle
Defines the visual style of the button. Options include:
ButtonSize: TFlexFMXButtonSize
Controls the button size: bsSmall (32px), bsDefault (40px), bsLarge (48px)
Text: string
The button's display text.
UseHTMLText: Boolean
When True, enables HTML rendering in the button text.
HTMLText: string
HTML formatted text when UseHTMLText is True. Supports:
- <b>Bold</b>
- <i>Italic</i>
- <s>Strikethrough</s>
- <font size="20">Sized text</font>
- <br> for line breaks
ImageSettings: TFlexFMXImageSettings
Configuration for button icons:
BadgeSettings: TFlexFMXButtonBadgeSettings
Badge notification configuration:
ButtonLayout: TFlexFMXButtonLayout
Layout mode: blImageAndText, blImageOnly, blTextOnly
GroupName: string
Groups buttons together for radio-button behavior.
StaysDown: Boolean
When True and part of a group, button stays selected when clicked.
FlexFMXCSS: TFlexFMXCSS
CSS classes for responsive layout integration (Bootstrap-like classes).

Usage Examples

Basic Button

Button1.ButtonStyle := bsPrimary;
Button1.Text := 'Click Me';
Button1.ButtonSize := bsDefault;

Button with Icon

Button1.ImageSettings.ImageList := ImageList1;
Button1.ImageSettings.ImageIndex := 0;
Button1.ImageSettings.Position := ipLeft;
Button1.ImageSettings.UseTint := True;

Button with HTML Text

Button1.UseHTMLText := True;
Button1.HTMLText := '<b>Bold</b> text with <i>italic</i>';

Button with Badge

Button1.BadgeSettings.Text := '5';
Button1.BadgeSettings.BadgeColor := TAlphaColors.Red;

Button Group

Button1.GroupName := 'MyGroup';
Button1.StaysDown := True;
Button2.GroupName := 'MyGroup';
Button2.StaysDown := True;

Image-Only Button

Button1.ButtonLayout := blImageOnly;
Button1.ImageSettings.ImageList := ImageList1;
Button1.ImageSettings.ImageIndex := 0;
Button1.ImageSettings.Position := ipCenter;
Button1.ImageSettings.ScaleMode := isFit;

Events

Event Description
OnClick Fired when button is clicked

Notes

← Back to Index