1. Put in your "uses" this -> "LCLType"
2. Go to object inspector, highlight your form (Form1?)
3. activate KeyPreview = True inside properties
4. Inside "Events" go to "OnKeyDown" and doubleclick the free space to create an empty handler
5. copy and paste this code:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState
);
var
NextControl: TWinControl;
begin
NextControl := nil;
if (Key = VK_RIGHT) or (Key = VK_DOWN) then
NextControl := FindNextControl(ActiveControl, True, True, False);
if (Key = VK_LEFT) or (Key = VK_UP) then
NextControl := FindNextControl(ActiveControl, False, True, False);
if (NextControl <> nil) then
begin
NextControl.SetFocus;
Key := 0;
end;
end;
6. Run your application, now only things that have TabStop and are focusable should be valid as a target by arrow keys
7. Reply in here if this is what you wanted to achieve