Hello! I have been working on code and wanna store Combo Box items in Application settings since that seems easiest. I have made the variable I made in the settings(comiclist) as Strings Collection basically. Anyways, when the user first loads the application, I have a form that comes up and allows the user to input values to populate the combobox. The code I have for them saving the values first is:
But the error I get is 'Object reference not set to an instance of an object.'Code:Private Sub txtData_KeyDown(sender As Object, e As KeyEventArgs) Handles txtData.KeyDown If (e.KeyCode = Keys.Enter) Then My.Settings.ComicList.Add(txtdata.Text) End If End Sub
I figured to add the .ToString() at the end of My.Settings.ComicList.Add(txtdata.Text) but nah, that didn't work. This is the first time I've worked with String Collection so anything I am doing wrong?




Reply With Quote
