← Back to Index

TFlexFMXInputDialog

Modal dialog for collecting text input from users with validation support.

Key Properties

Title: string
Dialog title text.
Prompt: string
Prompt message explaining what input is needed.
DefaultValue: string
Pre-filled default input value.
InputValue: string
User's entered value (after Execute).
InputType: TInputType
Type: itText, itPassword, itNumber, itEmail, itPhone.
MaxLength: Integer
Maximum character limit (0 = unlimited).
Required: Boolean
Prevent OK button if input is empty.
ValidationPattern: string
Regular expression for input validation.
ValidationMessage: string
Error message shown when validation fails.
Multiline: Boolean
Allow multiple lines of text input.

Usage Examples

Simple Text Input

Dialog1.Title := 'Enter Name';
Dialog1.Prompt := 'Please enter your name:';
Dialog1.DefaultValue := '';
Dialog1.Required := True;
if Dialog1.Execute = mrOK then
  ShowMessage('Hello, ' + Dialog1.InputValue);

Password Input

Dialog1.Title := 'Authentication';
Dialog1.Prompt := 'Enter your password:';
Dialog1.InputType := itPassword;
Dialog1.Required := True;
if Dialog1.Execute = mrOK then
  ValidatePassword(Dialog1.InputValue);

Email Validation

Dialog1.Title := 'Email Address';
Dialog1.Prompt := 'Enter your email:';
Dialog1.InputType := itEmail;
Dialog1.ValidationPattern := '^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$';
Dialog1.ValidationMessage := 'Invalid email format';
if Dialog1.Execute = mrOK then
  SendEmail(Dialog1.InputValue);

Multiline Input

Dialog1.Title := 'Comments';
Dialog1.Prompt := 'Enter your feedback:';
Dialog1.Multiline := True;
Dialog1.MaxLength := 500;
if Dialog1.Execute = mrOK then
  SaveFeedback(Dialog1.InputValue);

Numeric Input

Dialog1.Title := 'Enter Age';
Dialog1.Prompt := 'How old are you?';
Dialog1.InputType := itNumber;
Dialog1.ValidationPattern := '^\d{1,3}$';
Dialog1.ValidationMessage := 'Please enter a valid age';
if Dialog1.Execute = mrOK then
  Age := StrToInt(Dialog1.InputValue);

Methods

Events

Notes

← Back to Index