I am using a TEdit control to enter a decimal number, press "Enter", shift the focus to the next TEdit control to enter another number. I have written code that works, but only if I press "Ctrl-Enter" instead of "Enter". I thought #13 was the code for carraige return/enter key. If so, why does this only work using "Ctrl-Enter"? Any ideas would be appreciated.
Thanks,
Bob
procedure TfrmPV.edtODKeyPress(Sender: TObject; var Key: char);
begin
with Sender as TEdit do
ShowMessage('Begin');
case Key of
'0'..'9' : ShowMessage('0-9 was pressed.');
'.', ',' : ShowMessage('Period or Comma was pressed.');
#8 : ;
#13 : begin
ShowMessage('#13 was pressed.');
Panel1.SelectNext(Sender as TWinControl, True, True);
Key := #0;
end;
#10 : begin
Panel1.SelectNext(Sender as TWinControl, True, True);
Key := #0;
end;
else
Key := #0;
end;
end;