← Back to Index

TFlexFMXPassLock

PIN/passcode entry control with customizable length and visual feedback, ideal for app security.

Key Properties

PasscodeLength: Integer
Number of digits required (default: 4).
Value: string
Entered passcode value.
MaskCharacter: Char
Character displayed for each digit (default: '●').
ShowValue: Boolean
Display actual digits instead of mask characters.
ActiveColor: TAlphaColor
Color of filled/active digit circles.
InactiveColor: TAlphaColor
Color of empty digit circles.
ErrorColor: TAlphaColor
Color shown on validation error.
ShowKeyboard: Boolean
Display built-in numeric keyboard (mobile-friendly).
AllowBiometric: Boolean
Enable Face ID / Touch ID / Fingerprint option.
AutoSubmit: Boolean
Automatically validate when all digits entered.

Usage Examples

Basic PIN Entry

PassLock1.PasscodeLength := 4;
PassLock1.ShowKeyboard := True;
PassLock1.AutoSubmit := True;
PassLock1.ActiveColor := TAlphaColors.Blue;

6-Digit Code

PassLock1.PasscodeLength := 6;
PassLock1.MaskCharacter := '*';
PassLock1.OnComplete := PasscodeEnteredHandler;

Validation

procedure TForm1.PassLock1Complete(Sender: TObject);
begin
  if PassLock1.Value = '1234' then
  begin
    ShowMessage('Access granted');
    UnlockApp;
  end
  else
  begin
    PassLock1.ShowError;
    PassLock1.Clear;
  end;
end;

Biometric Option

PassLock1.AllowBiometric := True;
PassLock1.OnBiometricAuth := BiometricAuthHandler;

procedure TForm1.BiometricAuthHandler(Sender: TObject; Success: Boolean);
begin
  if Success then
    UnlockApp
  else
    ShowMessage('Authentication failed');
end;

Methods

Events

Notes

← Back to Index