Input Dialogs

InputBox

Displays an input dialog box that enables the user to enter a string.

System::AnsiString __fastcall InputBox(const System::AnsiString ACaption, const System::AnsiString APrompt, const System::AnsiString ADefault);

Description

Call InputBox to bring up an input dialog box ready for the user to enter a string in its edit box. The ACaption parameter is the caption of the dialog box, the APrompt parameter is the text that prompts the user to enter input in the edit box, and the ADefault parameter is the string that appears in the edit box when the dialog box first appears.

If the user chooses the Cancel button, InputBox returns the default string. If the user chooses the OK button, InputBox returns the string in the edit box.

Use the InputBox function when there is a default value that should be used when the user chooses the Cancel button (or presses Esc) to exit the dialog. If the application needs to know whether the user chooses OK or Cancel , use the InputQuery function.

InputQuery

Displays an input dialog that enables the user to enter a string.

bool __fastcall InputQuery(const System:: AnsiString ACaption, const System::AnsiString APrompt, System::AnsiString &Value);

Description

Call InputQuery to bring up an input dialog box ready for the user to enter a string in its edit box. The ACaption parameter is the caption of the dialog box, the APrompt parameter is the text that prompts the user to enter input in the edit box, and the Value parameter is the string that appears in the edit box when the dialog box first appears.

If the user enters a string in the edit box and chooses OK, the Value parameter changes to the new value.

InputQuery returns true if the user chooses OK, and false if the user chooses Cancel or presses the Esc key.

If the default value should be used when the user cancels out of the dialog, use InputBox .