Jump to content
m0njer0

Edit features

Recommended Posts

I am using delphi rad studio 12. Does this version have a TextPrompt feature for the edit component?

Share this post


Link to post

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 by JohnLM

Share this post


Link to post

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 by JohnLM

Share this post


Link to post
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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×