Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Auto increment textbox
Message
De
21/12/2005 02:46:34
 
 
À
21/12/2005 00:57:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01079782
Message ID:
01079792
Vues:
18
>Dear Experts
>
>Text1 has value 0 and the cursor is in text1.
>If I press plus sign(+) then text1 value should increase by 1
>If I press minus sign(-) then text1 value should derease by 1
>but the value should not go to below 0
>
>Please help

Use a spinner, or add this code to the KeyPress method:
LPARAMETERS nKeyCode, nShiftAltCtrl
Do case
  case chr(nKeyCode)='+'
    nodefault
    this.value=this.value+1
  case chr(nKeyCode)='-' and this.value>0
    nodefault
    this.value=this.value-1
Endcase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform