Skip to main content
A newer version of this page is available. .

dxInputQuery(string,string[],string[]) Method

Invokes a modal input dialog box that prompts a user to enter multiple text strings.

Declaration

function dxInputQuery(const ACaption: string; const APrompts: array of string; var AValues: array of string): Boolean;

Parameters

Name Type Description
ACaption string

The caption of the invoked input dialog box.

APrompts string

The array of labels for displayed text editors.

AValues string

Returns values of the text editors when a user clicks the OK button or presses the Enter key.

Returns

Type Description
Boolean

True if a user clicks the OK button or presses the Enter key. False if a user clicks the Cancel or Close button, or presses the Esc key.

Remarks

Call this function to invoke a simple input dialog box that prompts a user to enter one or more string values. The dialog imports all look & feel settings from the TdxSkinController component if it is in an application project.

Examples

The following code example invokes a modal input dialog box with three text editors:

var
  APrompts, AValues: array of string;
begin
  SetLength(APrompts, 3);
  SetLength(AValues, 3);
  APrompts[0] := 'First Name:';
  APrompts[1] := 'Last Name';
  APrompts[2] := 'E-mail:';
  dxInputQuery('New User', APrompts, AValues);
  // ...
end;

A skinned modal input dialog box with three text editors

If you need to display password characters instead of the actual user input, prepend an ASCII character whose number is less than #32 to one or more values passed as the APrompts parameter as shown below:

var
  APrompts, AValues: array of string;
begin
  SetLength(APrompts, 5);
  SetLength(AValues, 5);
  APrompts[0] := 'First Name:';
  APrompts[1] := 'Last Name';
  APrompts[2] := 'E-mail:';
  APrompts[3] := #31'Password:'; // Displays user input as password characters for "Password"
  APrompts[4] := #31'Repeat Password:'; // Displays user input as password characters for "Repeat Password"
  dxInputQuery('New User', APrompts, AValues);
  // ...
end;

A skinned input dialog box with multiple editors and password characters

Note

The displayed password characters depend on the global look & feel settings. If the RootLookAndFeel.NativeStyle property is set to True, a modal input dialog box displays bullets as password characters. Otherwise, the dialog box displays asterisks.

See Also