Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
KEYPRESS - EVENT (Trapping Alt or Ctrl)
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00121615
Message ID:
00122268
Vues:
18
>Here's an example that traps the Alt-F combo (which normaly brings up the File menu). When textbox1 has focus, the key is trapped and it's background is changed to red. When it loses focus, the Alt-F resumes it's normal behavior. This should work for Ctrl combinations as well.
>
>
PUBLIC oform1
>
>oform1=CREATEOBJECT("form1")
>oform1.Show
>RETURN
>
>DEFINE CLASS form1 AS form
>
>	Name = "Form1"
>
>	ADD OBJECT text1 AS textbox WITH ;
>		Left = 36, ;
>		Top = 60, ;
>		Name = "Text1"
>
>	ADD OBJECT text2 AS textbox WITH ;
>		Left = 36, ;
>		Top = 108, ;
>		Name = "Text2"
>
>	PROCEDURE text1.GotFocus
>		on key label alt+f _screen.activeform.activecontrol.backcolor = rgb(255,0,0)
>	ENDPROC
>
>	PROCEDURE text1.LostFocus
>		on key label alt+f
>	ENDPROC
>
>ENDDEFINE
>
Thanks Ken... but I was trying to get away from the ON KEY's (that we have now) and go to a more OOP approach. I was tired of PUSHing and POPping keys, etc.

I think we have found a more KISS approach and we are implementing it now. Using a menu item to capture our desired key press combination seems to work, and is easier to maintain.

Thanks again,
Wayne
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform