I'm just starting to develop and so there are some concepts that are not clear to me, I need you to try to understand what I'm doing wrong.
My goal is to have a series of ComboBoxes that contain some strings, for example a string is this one, the ComboBox is called TYPE:
I am storing these strings in My.Settings for my convenience and to edit them directly from the app.exe.config file (these information are stored there right?).
I'm using this code
Private Sub AdminPanel_Load(sender As Object, e As EventArgs) Handles MyBase.Load
For Each item In My.Settings.TYPE
ComboBoxType.Items.Add(item)
Next
End Sub
My issue is that, I'm unable to read from My.Settings.TYPE and when I try to write into it with the following code I doesn't find any strings added into My.Settings menu neither into app.exe.config.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles ButtonTYPEAddValue.Click
ComboBoxType.Items.Add(TextBoxType.Text)
ComboBoxType.Text = TextBoxType.Text
TextBoxType.Clear()
MsgBox("Item added!")
End Sub
what is wrong?

In your code, it seems like you've used
Stringto add/remove theComboBoxTypeitems. Follow the steps to achieve your requirement:In this screenshot, you can see I've set the Type as
System.Collection.Specialized.StringCollectionto separate each time for future use.Now, you may use the following code:
Form structure for the code:
On the
MyBase.Loadevent, all the items containing inMy.Settings.testswill be added usingFor Eachloop (benefit of StringCollection).Working example of the form [adding - removing using My.Settings]:
I hope you've got your answer.