I have a descendant of TCustomControl and want to process Tab key when user press it. But when I press Tab key the focused control on the form just changed. And OnKeyDown and OnKeyPress events didn't fire. How to solve the problem?
Asked
Active
Viewed 306 times
2
-
Handle the `CM_DIALOGKEY` message. Look for instance at [`this question`](http://stackoverflow.com/q/10470053/960757). – TLama Jul 04 '13 at 16:54
-
But we should use CM_DIALOGKEY message on TForm. May fix the issue on component (descendant of TCustomControl) level? – Dmitry Jul 04 '13 at 17:00
1 Answers
2
Have the component handle the WM_GETDLGCODE
message so it can return the DLGC_WANTTAB
flag. See the answer to this question for an example.
![](../../users/profiles/-1.webp)
Community
- 1
- 1
![](../../users/profiles/65863.webp)
Remy Lebeau
- 454,445
- 28
- 366
- 620