How do I disable the textchanged event of a textbox once it has been fired?
Posted on 2006-11-21
I have VS2005. I have on a form a textbox(TextBox1) and a datagrid. A barcode is entered into TextBox1 with a barcode scanner which fires the textchanged event and loads data from the database into the datagrid that coresponds to the barcode entered. I'm trying to set this up so I can enter more than one barcode to bring up more data for each barcode. I found using the textchanged event that when I clear just one number from the barcode in TextBox1 that the entry in the datagird clears. The textchanged event still fires clearing the entry from the datagrid. I would like to clear TextBox1 without clearing the entry in the datagrid. Is there a way to disable the textchanged event and then re-enable it when a new row is added to the datagrid?