Aryaman Bansal
Aryaman Bansal

Reputation: 83

Delphi - How to copy the text from one tedit to another, while the user is typing in the first one?

There are two tedit

One is enabled for the user, and the other disabled.

The moment user types anything in the tedit, the same thing gets typed in the disabled tedit, while the user is typing.

I don't want to use any buttons for this.

How to implement this in Delphi?

Upvotes: 0

Views: 634

Answers (1)

Sebastian Proske
Sebastian Proske

Reputation: 8413

You can use the OnChange event of your first TEdit and set text of the second edit to the text of the first. This should look like

procedure TForm1.Edit1Change(Sender: TObject);
begin
  Edit2.Text := Edit1.Text;
end;

Upvotes: 4

Related Questions