Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto increment textbox
Message
From
21/12/2005 02:46:34
 
 
To
21/12/2005 00:57:10
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01079782
Message ID:
01079792
Views:
19
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform