Solvedπ Saving/Editing/Removing ComboBox Data
Well, I'm trying to create a program that will hold data. The full explanation is in op. Basically, I need a method to store data from a combo box so when I restart the program, the data will still be there.
I don't want to use save.settings because when you move/copy the program, the settings get deleted... Unless there's a way around that
I don't want to use save.settings because when you move/copy the program, the settings get deleted... Unless there's a way around that

Use .xml ![=]](/forum/images/emotions/=].gif)
Its so simple to use as well!
Create a class and write this:
To Load,
To write:
Public Sub SaveSettings(ByVal Hallo As String)
You can figure the rest out on ya own. I won't spoon feed anyone ![=]](/forum/images/emotions/=].gif)
![=]](/forum/images/emotions/=].gif)
Its so simple to use as well!
Create a class and write this:
Code:
Public _SomeString As String
Public Sub New(ByVal SomeString As String)
Me._SomeString = SomeString
End Sub
'For your case, you'll need to make an array just like this!
Code:
Dim fileLoc As String = Application.StartupPath & "\Settings.xml"
Public Sub LoadSettings()
If My.Computer.FileSystem.FileExists(fileLoc) Then
Dim document As XmlReader = New XmlTextReader(fileLoc)
While (document.Read())
Dim type = document.NodeType
If (type = XmlNodeType.Element) Then
If (document.Name = "ThisString") Then
dim x as string = document.ReadInnerXml.ToString()
End If
End While
document.Close()
End If
Public Sub SaveSettings(ByVal Hallo As String)
Code:
Dim set as New clsInfoSettings(Hallo)
Dim settings As XmlWriterSettings = New XmlWriterSettings()
With settings
.Indent = True
End With
Using writer As XmlWriter = XmlWriter.Create(fileLoc, settings)
With writer
.WriteStartDocument()
.WriteStartElement("Program_Settings")
.WriteElementString("ThisString", SomeString)
.WriteEndElement()
.WriteEndDocument()
.Close()
End With
End Using
End Sub
![=]](/forum/images/emotions/=].gif)
Thanks for the help, though I already recieved help from 1UP. Since you never posted back I thought you wouldn't have bothered. This is good for anyone else that needs it though 

//Solved
-VM/PM me if it's not
-VM/PM me if it's not

This thread is closed for replies.
Similar Threads
Visual Basic Programmingβ [Help] Save Items in Combobox[Solved]FA 8 Borderlands 2 Hackshow to use Gibs Save EditIA 2 Call of Duty Modern Warfare 2 Help[SOLVED]Map Saving/Editing
3 Crysis 2 HelpIs it possible to edit(remove) the suit voice?
2 Staff Disputesβ Threads about Packet Editing Removed?
2
