### How to restrict the input by user to Positive numbers, Zero and Negative numbers into edit box in a GUI?

Posted:

**24 May 2019, 15:35**Hello friends...

Please look at these codes-

in the above codes you can see that i have added number keyword in each edit box which means that user can input only numbers in the edit fields. if anyone tries to enter anything else other than number then it shows error like this-

But, here the problem is that when i try to insert any negative value (like -100) in the edit box then it shows the same error also, while I want that it should accept negative numbers also. If anything else other than positive numbers, zero and negative numbers is inserted into edit boxes then it should show the above error.

Please fix this problem and provide any solution...

Thanks a lot...

Please look at these codes-

Code: Select all

```
Gui Add, Edit, x183 y57 w205 h51 number,
Gui Add, Edit, x184 y128 w205 h51 number,
Gui Add, Edit, x185 y199 w205 h51 number,
Gui Show, w547 h338, Window
Return
```

But, here the problem is that when i try to insert any negative value (like -100) in the edit box then it shows the same error also, while I want that it should accept negative numbers also. If anything else other than positive numbers, zero and negative numbers is inserted into edit boxes then it should show the above error.

Please fix this problem and provide any solution...

Thanks a lot...