Ver Mensaje Individual
  #4  
Antiguo 18-09-2010
chingolo chingolo is offline
Miembro
 
Registrado: feb 2008
Posts: 12
Reputación: 0
chingolo Va por buen camino
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
Responder Con Cita