Einzelnen Beitrag anzeigen

nahpets
(Gast)

n/a Beiträge
 
#5

AW: [gelöst] Cursortasten von Buttons fernhalten

  Alt 20. Sep 2017, 10:13
Noch ein bisserl kürzer:
Delphi-Quellcode:

procedure TForm1.ApplicationEvents1ShortCut(var Msg: TWMKey; var Handled: Boolean);
begin
   if (ActiveControl is TButton) then
   begin
      Handled:= True;
      case Msg.CharCode of
         VK_LEFT : (ActiveControl as TButton).Left := (ActiveControl as TButton).Left - 16;
         VK_UP : (ActiveControl as TButton).Top := (ActiveControl as TButton).Top - 16;
         VK_RIGHT : (ActiveControl as TButton).Left := (ActiveControl as TButton).Left + 16;
         VK_DOWN : (ActiveControl as TButton).Top := (ActiveControl as TButton).Top + 16;
      else
         Handled := False;
      end
   end;
end;
  Mit Zitat antworten Zitat