Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TextBoxes and backspace
Message
 
To
01/08/2003 10:46:27
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00815859
Message ID:
00815971
Views:
17
Thanks Cetin

It works fine but i found an exception where it doesn't work, when the input mask is something like this: (999) 999-9999 (telephone), here's my code to fix it.
*-- KeyPress Method
LPARAMETERS nKeyCode, nShiftAltCtrl

If This.KeyPressNoDefault( nKeyCode, nShiftAltCtrl )
	NoDefault
EndIf

*-- KeyPressNoDefault Method
LPARAMETERS nKeyCode, nShiftAltCtrl
Local llRet

llRet = .F.
If oEnv.oSettings.BackSpaceBehavior = 0
	If Vartype(nKeyCode) = "N" And This.SelLength = 0 AND nKeyCode=127
		If Substr(Alltrim(This.InputMask),1,1) = "("
			IF This.SelStart = 1
				llRet = .T.
			Endif
		Else
			IF This.SelStart = 0
				llRet = .T.
			Endif
		EndIf
	EndIf
EndIf

Return llRet
>>Is there any settings i can apply to textboxes so when backspace is pressed and the cursor is at the beginning of the textbox the focus is not set to the previous control but remains in the textbox?
>>
>>Thanks.
>
>
*keypress
>LPARAMETERS nKeyCode, nShiftAltCtrl
>If this.SelStart=0 and nKeyCode=127
> NoDefault
>endif
Cetin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform