Skip to main content

dxInputQuery(string,string,string) Method

Invokes a modal input dialog box that prompts a user to enter a string.

Declaration

function dxInputQuery(const ACaption: string; const APrompt: string; var AValue: string): Boolean;

Parameters

Name Type Description
ACaption string

The caption of the invoked input dialog box.

APrompt string

The label of the displayed text editor.

AValue string

Returns the text editor’s value 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 the dxInputQuery function to invoke a simple input dialog box that prompts a user to enter one string value. The dialog box imports all look & feel settings from the TdxSkinController component if it is in an application project.

Code Examples

Create a Simple Input Dialog Box

The following code example invokes a simple modal input dialog box:

uses
  dxInputDialogs; // This unit declares the dxInputQuery function
// ...

var
  AUserInput: string;
begin
  dxInputQuery('Rename', 'New Name:', AUserInput);
  // ...
end;

VCL Editor Library: A Simple Modal Input Dialog Box with an Applied Skin

Create a Dialog Box for Password Input

If you need to display password characters instead of actual user input, prepend an ASCII character whose number is less than 32 (for example, '#31' in Delphi or "/x31" in C++Builder) to the APrompt parameter value as shown below:

uses
  dxInputDialogs;  // This unit declares the dxInputQuery function
// ...

var
  AUserInput: string;
begin
  dxInputQuery('Enter Password', #31'Password:', AUserInput);
  // ...
end;

VCL Editor Library: A Simple Modal Input Dialog Box that Shows Password Characters

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.

Other Input Query Functions

You can call the following global functions to invoke a modal input dialog box with multiple text editors:

dxInputQuery(string,string[],string[])
Invokes a modal input dialog box that prompts a user to enter multiple text strings.
dxInputQuery(string,string[],string[],TdxInputQueryValidationProc)
Invokes an input dialog box that allows users to enter a string.
See Also