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?
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.