m0njer0 0 Posted February 13 I am using delphi rad studio 12. Does this version have a TextPrompt feature for the edit component? Share this post Link to post
JohnLM 14 Posted February 13 (edited) Yes, it's the InputBox() function. See: InputBox (Delphi) - RAD Studio Code Examples (embarcadero.com) (add the vcl.dialogs in the uses section if it is not already there.) Sample usage: procedure TForm1.Button3Click(Sender: TObject); var InputString: string; begin InputString:=InputBox( 'Input Box', 'Prompt', ''); if InputString<>'' then edit1.Text:=InputString; end; Edited February 13 by JohnLM Share this post Link to post
JohnLM 14 Posted February 13 (edited) Here is another method: procedure TForm1.Button2Click(Sender: TObject); var nameStr: string; begin if inputquery('Name:', 'Enter Name:', nameStr) then edit.Text:=nameStr; end; Edited February 13 by JohnLM Share this post Link to post
dummzeuch 1505 Posted February 13 2 hours ago, m0njer0 said: I am using delphi rad studio 12. Does this version have a TextPrompt feature for the edit component? What do you mean by "TextPrompt"? Something like TEdit.TextHint (aka cue banner)? (for FMX the property is called TextPrompt) Share this post Link to post
PeterBelow 238 Posted February 13 2 hours ago, m0njer0 said: I am using delphi rad studio 12. Does this version have a TextPrompt feature for the edit component? See the TextHint property of TEdit, that's probably what you are looking for. If not give us more detail. Share this post Link to post