Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fun with Textboxes
Message
 
 
À
17/09/1998 23:27:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00138043
Message ID:
00138502
Vues:
14
I realize you're showing a fox trick, but here's something that can go in the KeyPress which will give the correct effect:
*-- If this is a lower case letter
IF BETWEEN(nKeyCode,ASC("a"),ASC("z"))
    *-- If it is the first letter or a letter after a space
    IF this.SelStart=0 OR (this.SelStart>0 and SUBSTR(this.Value,this.SelStart,1)=" ")
        *-- Uppercase the letter
        NODEFAULT
        RETURN DoDefault(nKeyCode-32,nShiftAltCtrl)
    ENDIF
ENDIF

*-- If this is an upper case letter
IF BETWEEN(nKeyCode,ASC("A"),ASC("Z"))
    *-- If it is the not the first letter or a letter after a space
    IF !(this.SelStart=0 AND (this.SelStart>0 and SUBSTR(this.Value,this.SelStart,1)=" "))
        *-- Lowercase the letter
        NODEFAULT
        RETURN DoDefault(nKeyCode+32,nShiftAltCtrl)
    ENDIF
ENDIF
>I think because it's resetting the "SelStart" value.
>
>>Thanks for the Stupid FoxPro Trick, John. :)
>>
>>You also can have fun simply with
>>
>> THIS.Value=THIS.Value
>>
>>in InteractiveChange. Wonder why it does that??
Rick Hodder
MCP Visual Foxpro
C#, VB.NET Developer
Independent Consultant
www.RickHodder.com
MyBlog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform