Why won't my control accept keyboard input?

后端 未结 5 1114
梦谈多话
梦谈多话 2021-01-18 23:09

I\'ve built a custom control that I\'m trying to send input to. It will accept mouse input and report MouseDown, MouseMove and MouseUp correctly, but for whatever reason, i

5条回答
  •  别那么骄傲
    2021-01-18 23:50

    Do you have WS_TABSTOP set? You don't have input focus without that, I believe. But this is based on a recollection from nearly 10 years ago, when I was writing my own syntax-highlighting code editor, for which I have long since lost the source.

    {TWinControl.}TabStop := True; ought to do. A quick test app with a do-nothing component derived from TWinControl and displaying a dialog for key events seems to show that it makes all the difference.

提交回复
热议问题