I have a Windows form that previously contained custom AutoComplete functionality and was tied to about 15 textboxes. I just finished stripping those textboxes and replacing them with standard unbound comboboxes with AutoComplete turned on.
EVERY time I open the form, access a record or two. THEN I close and reopen the form. WHEN I POPULATE EITHER THE FIRST OR SECOND RECORD AGAIN....StackOverflowException. Until I replaced textboxes with comboboxes, this form has worked for three years.
I don't ever use comboboxes. So there are several things to note that I may or may not be doing correctly when using VB's combobox.
1) With my original autocomplete, I never performed a cmbobox.DataSource = dv, combobox.DisplayMember = "id", cmbobox.ValueMember = "desc" etc. until the textbox was active. Also, my autocomplete used a listbox instead of a combobox. Now, I create With combobox.DataSource etc. for ALL of these comboboxes on FormLoad. Is this appropriate or should I do this individually only when each combobox is accessed?
2) When I populate the form using a dataview I populate the comboboxes with the .SelectedValue and not .Text. It eleviates having to join all of these tables to my main table in a SQL select. Is this inappropriate? Should I set .Text?