Results 1 to 5 of 5

Thread: My.Settings save Combobox Items?

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2016
    Posts
    95

    Resolved My.Settings save Combobox Items?

    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:
    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
    But the error I get is 'Object reference not set to an instance of an object.'
    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?
    Last edited by Dragnorian; May 31st, 2017 at 03:34 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width