📜  如何在delphi代码示例中使形状移动

📅  最后修改于: 2022-03-11 14:54:56.291000             🧑  作者: Mango

代码示例1
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  case Key of
    VK_UP:
      Shape1.Top := Shape1.Top - 10;
    VK_DOWN:
      Shape1.Top := Shape1.Top + 10;
    VK_LEFT:
      Shape1.Left := Shape1.Left - 10;
    VK_RIGHT:
      Shape1.Left := Shape1.Left + 10;
  end;
end;