Topic: How to call a form.button.click pressing ENTER

Hi!
Do any of you know how to do that after entering a value in a cell and press ENTER that calls a form.button.click?
Thanks!!

Re: How to call a form.button.click pressing ENTER

procedure Form1_Edit1_OnKeyDown (Sender: string; var Key: Word; Shift, Alt, Ctrl: boolean);
begin
    If Key = 13 then Form1.Button1.Click;    // The Button1 action is set to Show Form2
end;

However, you do not need to simulate the button click unless you have a reason to.,  You can just call the form  - see below
   If Key =13 then Form2.Show;

Re: How to call a form.button.click pressing ENTER

ehwagner wrote:

procedure Form1_Edit1_OnKeyDown (Sender: string; var Key: Word; Shift, Alt, Ctrl: boolean);
begin
    If Key = 13 then Form1.Button1.Click;    // The Button1 action is set to Show Form2
end;

However, you do not need to simulate the button click unless you have a reason to.,  You can just call the form  - see below
   If Key =13 then Form2.Show;

Thanks ehwagner!!! That works ok!!