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 |
|
Remarks
Call the dxInputQuery
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.
Code Examples
Create an Input Dialog Box with Three Editors
The following code example invokes a modal input dialog box with three text editors:
uses
dxInputDialogs; // This unit declares the dxInputQuery function
// ...
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;
Create a Dialog Box for Password Input
An input dialog box can display password characters instead of actual user input in any text box. To display password characters in a text box, prepend an ASCII character whose number is less than 32
(for example, #31
in Delphi or /x31
in C++Builder) to the caption of the target text box as demonstrated in the following code example:
uses
dxInputDialogs; // This unit declares the dxInputQuery function
// ...
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;
Note
Displayed password characters depend on the current global look & feel settings. If the native style is enabled, a modal input dialog box displays bullets as password characters. Otherwise, the dialog box displays asterisks.