Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting if caps lock pressed in textbox
Message
From
27/04/2018 15:51:19
 
 
To
27/04/2018 11:40:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Miscellaneous
Thread ID:
01659612
Message ID:
01659622
Views:
88
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
Previous
Reply
Map
View

Click here to load this message in the networking platform