Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TextBoxes and backspace
Message
From
02/08/2003 04:48:19
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00815859
Message ID:
00816169
Views:
23
You're welcome.
*-- KeyPress Method
LPARAMETERS nKeyCode, nShiftAltCtrl
If nKeyCode=127 and oEnv.oSettings.BackSpaceBehavior = 0 and ;
  This.SelLength = 0 And ;
  This.SelStart = iif(ltrim(This.InputMask) = "(", 1, 0)
  
  NoDefault
EndIf
I couldn't resist modifying the code:) Net result is same (set exact off - default).
At least we had a drink together with you and Jim, I think you won't get angry with me doing it:)
Cetin

>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform