Dmitry
Dmitry

Reputation: 14632

How to process Tab key by TCustomControl descendant?

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?

Upvotes: 2

Views: 409

Answers (1)

Remy Lebeau
Remy Lebeau

Reputation: 598329

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.

Upvotes: 2

Related Questions