Good afternoon,
I would like some help with the code for validating the text that is being entered into an inputbox in vb / winforms.
Current Code:
stringFromInputBox = InputBox("How much has the customer paid? " + Environment.NewLine + Environment.NewLine + "Don't forget to amend the account or take the cash through EPOS." + Environment.NewLine + Environment.NewLine + "Balance Due : £" + balanceDue.ToString + " ", "PAYMENT TAKEN")
I would like to be able to stop the user from entering anything other than numbers, but also allow them to enter a decimal (for £5.50 for example). I would also like to restrict the minimum to 0, and the maximum to be balanceDue.
I have found several, rather long winded ways to do this, but I am hoping that the .net framework has some more efficient and less 'brittle' methods.
InputBoxdoesn't provide this functionality. You'll have to create a window (input box) yourself and add the validation you want.