How can I handle the arrow keys in a custom component in delphi?

I am using delphi XE. I am developing a component that comes from TPanel. TApGUITab=class(Tpanel) I handled the key down event by processing the WMKeyDown message, but it does not fire when I press the arrow keys, and instead of triggering the event, it sets focus to another control. What should I do now?

+3
source share
1 answer

It is easy. Just reply to the message WM_GETDLGCODEand return

Message.Result := Message.Result or DLGC_WANTCHARS or
                                     DLGC_WANTARROWS or DLGC_WANTTAB or
                                     DLGC_WANTALLKEYS;
+4
source

Source: https://habr.com/ru/post/1771567/


All Articles