I have a simple Calculate Change form that allows a user to enter a price and amount paid, then it calculates the change and breaks it down into dollars, quarters, dimes, etc..
My problem is on validating the text in the two textboxes (price and paid). I am checking to make sure the text that is entered is numeric (using the Lost_Focus event)...if they try to tab to the next field and their input wasn't numeric it should show a messagebox, which it does, but then it shows the messagebox notice for the field they tabbed to as well....which isn't right...It should show the messagebox, then select all the text in the textbox that didn't have valid input....
Can someone check this out for me and let me know what I am doing wrong... Thanks!
The only problem I see with it is if there is invalid text in a textbox and you try to exit it gets held up by the validation. You should be able to use a flag or what not to get around that though.
in VB6 we checked the ascii value on the key_press event of the text box. Check to make sure the key pressed is a number, otherwise don't put value in text box.
Haven't got pc with .net with me at the mo so can't try this.