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

dxInputBox(string,string,string) Method

Invokes a modal input dialog box that prompts a user to confirm the displayed text string or change it.

Declaration

function dxInputBox(const ACaption: string; const APrompt: string; const ADefaultValue: string): string;

Parameters

Name Type Description
ACaption string

The caption of the invoked input dialog box.

APrompt string

The label of the displayed text editor.

ADefaultValue string

The default value displayed in the text editor.

Returns

Type Description
string

The editor value.

Remarks

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

Example

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

var
  AUserInput: string;
begin
  AUserInput := dxInputBox('Add a New User', 'User name:', 'User1');
  // ...
end;

A simple modal input dialog box with predefined text

Note

If you need to display password characters instead of the 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 value passed as the APrompt parameter.

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.

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

See Also