Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Teclas aceleradoras
Message
De
21/12/2006 08:26:19
 
 
À
21/12/2006 07:39:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01179492
Message ID:
01179507
Vues:
11
>>¿Cómo asigno una tecla "aceleradora" a un botón?. Es decir, ¿cómo hago para que al pulsar F2, por ejemplo, se dispare el evento click de un determinado botón del formulario?.
>
>He intentado con
ON KEY LABEL
pero no atino a utilizarlo.
>
>Hago algo así:
>
>
ON KEY LABEL F2 THISFORM.BOTON1.CLICK
>
>pero obtengo un error de que no puedo utilizar THISFORM sino en un método.




En tu ejemplo debes tomar una referencia al objeto. Por ejemplo, en forma genérica:
ON KEY LABEL F2 _SCREEN.ACTIVEFORM.BOTON1.CLICK()
De todas maneras, esa llamada rompe una de las reglas de OOP y por ende es mal diseño. "Métodos nunca deben llamar a eventos".

En lugar de ello, haz que el método Click() y tu llamada externa, ambas llamen (pasen un mensaje) a un método común.


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform