I have some TEdits on my app to enter data.
I'm trying to detect when enter is pressed, to move to the next edit.
This works:
but when it does I get a sound like the windows critical exclaim.
If I add a button and do this:
I don't get the sound.
Why do I get the sound with the OnKeyPress method?
Steve (Delphi 2007 & XP)
I'm trying to detect when enter is pressed, to move to the next edit.
This works:
Code:
procedure TSDIAppForm.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if GetKeyState(VK_Return) < 0 then Edit2.SetFocus;
end;
but when it does I get a sound like the windows critical exclaim.
If I add a button and do this:
Code:
procedure TSDIAppForm.Button4Click(Sender: TObject);
begin
Edit2.SetFocus;
end;
I don't get the sound.
Why do I get the sound with the OnKeyPress method?
Steve (Delphi 2007 & XP)