I am trying to code a SpinGadget that only accepts numbers between 1 and 999.
I wanted then to limit the number of characters in the gadget to 3 and only allow numbers to be typed.
The problem is that the way I have coded it, it accepts letters and up to 4 characters.
Can someone give a tip?
Thanks!
PS->There is a typo in the PB 5.20 help because in one part it says we don't have to use a SetText but in other example, it uses it.
Kind regards,
>Marco A.G.Pinto
---------------
Code: Select all
; Time
TextGadget(#TEXT_WINDOW_SET_TIME,10+5+2,10+5,100,20+2+1,"Time:")
SpinGadget(#TEXTBOX_WINDOW_SET_TIME,10+5+2+100-20-20-10,10+5-2,100-20-40+5+15-5-5,20, 1, 999,#PB_Spin_Numeric)
x=600
SetGadgetState(#TEXTBOX_WINDOW_SET_TIME, x)