Only numbers in StingGadgets
Posted: Mon Jan 28, 2002 11:49 pm
Code updated For 5.20+ (same As StringGadget() with Flag #PB_String_Numeric )
Restored from previous forum. Originally posted by Pupil.
I don't know if someone prior to me has posted something similar on this forum.
This is how you do if your string gadget only should accept numeric characters as input:
Note that you have to open a window prior to the above code.
Is there an easier way to accomplish the above?
Restored from previous forum. Originally posted by Pupil.
I don't know if someone prior to me has posted something similar on this forum.
This is how you do if your string gadget only should accept numeric characters as input:
Code: Select all
#ES_NUMBER=$2000
ghandle.l=StringGadget(0,10,10,100,20,""); this should input numbers only
flag.l=GetWindowLong_(ghandle,#GWL_STYLE)
SetWindowLong_(ghandle,#GWL_STYLE,flag|#ES_NUMBER); now it should work as wanted
Is there an easier way to accomplish the above?