Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
function InputQuery(const ACaption, APrompt; var Value: string): boolean;
InputQuery displays an input dialog box that enables the user to enter a string.
ACaption is the caption of the dialog box, APrompt the text that prompts the user to enter input in the edit box, and Value appears in the edit box when the dialog box first appears.
InputQuery returns True if the user chooses OK (Value contains the changed string), and False if the user chooses Cancel or presses the Esc key.
uses Dialogs;
...
var s, name : string;
r:boolean;
s := 'default name';
r := InputQuery('Name input',
'Please enter your name', s);
if r then Showmessage('Your name is: ' + s)
else ShowMessage('User canceled the input!');
|
InputBox,
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|