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 the dxInputBox
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.
Code Example
The following code example invokes a simple modal input dialog box with predefined text:
uses
dxInputDialogs; // This unit declares the dxInputBox function
// ...
var
AUserInput: string;
begin
AUserInput := dxInputBox('Add a New User', 'User name:', 'User1');
// ...
end;
Note
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 value passed as the APrompt
parameter.
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 Dialog Display Methods
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.