Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detecting if caps lock pressed in textbox
Message
De
27/04/2018 15:51:19
 
 
À
27/04/2018 11:40:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Divers
Thread ID:
01659612
Message ID:
01659622
Vues:
89
bindevent keypress event to a custom method for detect where capslock()=.t. or .f. (when typing any thing in the textbox)
this is a test form (type in textbox and switch capslock state manually for test) .Note the label can be also "wait window... nowait"
PUBLIC oform
oform=NEWOBJECT("form1")
oform.Show
RETURN
*
DEFINE CLASS form1 AS form
	Top = 0
	Left = 0
	Height = 113
	Width = 301
	Caption = "Form1"
	Name = "Form1"

	ADD OBJECT text1 AS textbox WITH ;
		Height = 49, ;
		Left = 36, ;
		Top = 24, ;
		Width = 193, ;
		Name = "Text1"

	ADD OBJECT label1 AS label WITH ;
		AutoSize = .T., ;
		FontSize = 11, ;
		Caption = "", ;
		Height = 19, ;
		Left = 48, ;
		Top = 84, ;
		Width = 2, ;
		ForeColor = RGB(255,0,0), ;
		Name = "Label1"

	PROCEDURE my
		LPARAMETERS nKeyCode, nShiftAltCtrl
		local m.x
		m.x=iif(capslock()=.t.," ON"," OFF")
		THISFORM.LABEL1.caption="Warning...capslock state :"+m.x
	ENDPROC


	PROCEDURE text1.Init
		BINDEVENT(this,"KEYPRESS",thisform,"my")
	ENDPROC

ENDDEFINE
*
*-- EndDefine: form1
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform