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:
00122101
Vues:
14
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
kenweber
GCom2 Solutions
Microsoft Certified Professional

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform