Hola megadigit, para saber quien tiene el foco existe una propiedad heredada de TWincontrol que es la funcion Focused.
Esto es de la ayuda de delphi:
Determines whether the control has input focus.
function Focused: Boolean; dynamic;
Description
Use the Focused method to see if the control is the active control. When Focused returns True, the control has the input focus. If Focused returns False, the user cannot interact with the control.
la forma de usar es simple ej: button2.focused //devuelve true o false
ahora el tratamiento del evento lo tenes que hacer en la form, poniendo la keypreview a true y en el onkeyup (si lo haces en algun otro evento anterior como en el onkeypress o keydown creeria q el foco todavia no se paso), fijate quien tiene el foco usando key=KV_TAB
|