odd textbox behaviour - bug?
I have a controls on a form bound to a binding source. The first control (textbox) is my auto-number field and is read only. I also have a function that clears all the controls (textboxes, combo's, and date pickers) on the form when a user deletes a record or clicks the "add new" button. After this occurs, the focus is put (not by me) on the auto-number field textbox. From that point on I am not able to get out of the textbox unless I stop the debugger and restart the program. Its like it is stuck in the textbox. I have tried taking the tabstop away and as long as I don't click in the textbox I am ok. The second I do it I am stuck in it again. I can't even close the form with the "X".
The causesvalidation is set to true for this control and there is no validating event other than in the formclosing event and the delete event of a datagrid on the form. Both use cancel if the underlying dataset has changes. I commented these out and still the same problem.
Oh well, I was actually looking to allow a user to type in the field anyway to bring up the record based on the id they typed in (right now I have them click on a button which brings up a list of the records, and from that they select the record to populate the form with). I just thought it was odd that I couldn't exit the field and wasn't sure if I had something occurring somewhere in the form that was causing it.