Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keyboard specific key
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01455293
Message ID:
01455451
Views:
47
How dare you to post not fully tested code! People should be able to use it right away not waste there time on adapting and testing it.

>
>
>Put this in KeyPress Event of the TextBox:
>
>
>LPARAMETERS nKeyCode, nShiftAltCtrl
>
>IF nKeyCode == 46 && [.]
>   LOCAL nStart
>   nStart = this.SelStart 
>   NODEFAULT 
>   DO CASE
>      CASE nStart < 5    
>           this.Value     = PADL(ALLTRIM(LEFT(this.Value,3)),3)+SUBSTR(this.Value,4)
>           this.SelStart  = 4
>           this.SelLength = 3
>
>      CASE nStart < 9    
>           this.Value     = LEFT(this.Value,4)+PADL(ALLTRIM(SUBSTR(this.Value,5,3)),3)+SUBSTR(this.Value,8)
>           this.SelStart  = 8
>           this.SelLength = 3
>
>      CASE nStart < 13    
>           this.Value     = LEFT(this.Value,8)+PADL(ALLTRIM(SUBSTR(this.Value,9,3)),3)+SUBSTR(this.Value,12)
>           this.SelStart  = 12
>           this.SelLength = 3
>   ENDCASE
>ENDIF
>
>
>NOT WELL TESTED!!!!
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform