CoachBarker
Well-known member
- Joined
- Jul 26, 2007
- Messages
- 133
- Programming Experience
- 1-3
I have one combo box on a form that I would like to load from a text file. This I can do, now I would like to be able to add items (extensions) into the combo box and have the items added directly to the text file.
To load the combo box I am doing this and calling it on Form Load;
Somewhere I had the code to do what I want but seems I lost it somehow
Any help?
To load the combo box I am doing this and calling it on Form Load;
VB.NET:
Public Sub loadComboBox()
'Create a collection and initialise it using the array returned by reading the lines of the file.
Dim lines As New List(Of String)(IO.File.ReadAllLines("../../TextFiles\ComboBox.txt"))
For Each item As String In lines
Me.cboFileExtension.Items.Add(item)
Me.cboFileExtension.Sorted = True
Me.cboFileExtension.SelectedIndex = 0
Next
End Sub
Somewhere I had the code to do what I want but seems I lost it somehow

Any help?