procedure TForm1.Button1Click(Sender: TObject);
var
InputString: string;
begin
InputString:= Dialogs.InputBox('Input Box', 'Prompt', 'Default string');
Edit1.Text:= InputString;
end;
Here is an example code snippet for the new InputBox with the anonymous function:
InputBox('What do you want to say?','','Stuff',
procedure(const AResult: TModalResult; const AValue: string)
begin
case AResult of
{ Detect which button was pushed and show a different message }
mrOk:
begin
// AValue is the result of the inputbox dialog
end;
mrCancel:
begin
end;
end;
end
);
Head over and check out the documentation of the new non blocking InputBox function on the Embarcadero DocWiki.