derek7467
asked on
Save combobox entries to textfile
I have a combobox that i want to save to a textfile when clicking a button, it should append all entries to a new line UNLESS it already exists. I have the below code, but it doesnt save, it doesnt do anything, but no errors.
If a prepopulate the textfile with entries i am able to load it completely fine with the below code:
Dim content(TextBox1.Items.Count - 1) As String
TextBox1.Items.CopyTo(content, 0)
IO.File.WriteAllLines("C:\SWDEPOT\test.txt", content)
If a prepopulate the textfile with entries i am able to load it completely fine with the below code:
Dim load() As String = IO.File.ReadAllLines("C:\SWDEPOT\test.txt")
Array.Reverse(load)
TextBox1.Items.AddRange(load)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.