Answers for "delphi keydown enter"

1

delphi keydown enter

procedure TForm.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if (Key = #13) then  //#13 enter
  begin
    Key := #0;  //clear key press
    {enter extra code}
    Perform(WM_NEXTDLGCTL, 0, 0);  {Move to next object in turn}
  end;
end;
  
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  case Key of
    VK_RETURN: {enter extra code};
  end;
end;
Posted by: Guest on November-10-2020

Browse Popular Code Answers by Language