Hi,
I am new to programming and am trying to create an application with Winforms with a SQL database behind to hold the records. I have a problem with a text box that I use to record a product ID. Beside the textbox I have a button which opens a separate form to search the product records by description but it works OK. I want to add functionality that will allow the user to input the ID directly into the box, then check that it is a valid product ID and so far this all works but if I type say the number 3 in the textbox and then delete it, it wil not allow me to leave the textbox without inputting a number, I cannot even clieck the search button. What am I doing wrong? I've tried everything that I can think of. I have a keypress function that only allows numbers and backspace (to allow to clear) and the check on an inputted number is based on the leave event. Any help would be gratefuly accepted.
Loading
Blaithin SurgeonerPosted Feb 8, 2010, 7:12 AM
Hi Karan,
Thanks for the quick reply but I have already tried that and it works as long a you have not previously entered something in the textbox. So for example, if I input 1 and press TAB to leave, that is OK but if I then go back and delete the 1, it will not let me leave the textbox. It is fine if I reload the form and the textbox is empty, I can leave the cell OK, it's only if I have removed the contents. Any other suggestions?
Blaithin