Il 05/03/2018 09:41, Lubos Pintes via Lazarus ha scritto:

Hello and thank. And in general, if I have a TControl instance, can you tell me a reliable algorithm that tells me if the control has a focus?

By definition, the focused control is the control which receives keyboard input. That's why the form in itself is never focused because a form doesn't handle keyboard input. With just a form you may strike any key, and nothing will happen: the keyboard input is simply ignored.

The Form's ActiveControl property tells you which control has focus and will receive the keyboard input.

The control's Focused property tells you if the control has focus.

The focused control may be a button a TEdit, or whatever control which may perform an action upon striking a key. You may push a focused button by striking the enter key or the space bar, you may enter text on a Tedit, etc.

Giuliano

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to