I have problem with several things:
edit1.text
be blank when i hit enter (i think it should be on onEnter event but not so sure)Edit1.text
to array?With all that said all i wanna do is:
Enter a name in edit, click enter, and then enter another name in same edit and previous name to be saved in some variable or array. Is this even possible?
I tried procedure TForm1.Edit3Enter(Sender: TObject);
but when i click enter nothing happens.
The OnEnter
event is triggered when the Edit control receives keyboard input, not when the user pressed the Enter key. You should be using the OnKeyPress
event for that, eg:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
var
S: String;
begin
if Key = #13 then
begin
Key := #0;
S := Edit1.Text;
Edit1.Clear;
// do something with S...
end;
end;