![]() |
Ein Image mit den Pfeiltasten steuern
Benötigt wird ein TImage auf dem Formular, weiter muss die KeyPreview des Formulares auf True gestellt werden.
Delphi-Quellcode:
Von sakura!
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState); begin case Key of VK_LEFT: begin Image1.Left := Image1.Left - 5; Key := 0; end; VK_RIGHT: begin Image1.Left := Image1.Left + 5; Key := 0; end; VK_UP: begin Image1.Top := Image1.Top - 5; Key := 0; end; VK_DOWN: begin Image1.Top := Image1.Top + 5; Key := 0; end; end; end; Grüsse, Daniel :hi: |
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:22 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz