Can anyone explain why the OnKeyPress Event does not work with a TButton on the same Form. What am I doing wrong?
procedure TForm1.Button1Click(Sender: TObject);
begin
Label1.Caption:='button';
end;
procedure TForm1.KeyPress(Sender: TObject; var Key: Char);
begin
if Key='a' then Label1.Caption:='OK';
end;