Hi guys , how can i save some texts from textboxes into a word in a listbox so when i will reopen the program i will continue having the save?


Recommended Answers

All 4 Replies

you can either save it in My.Settings or create a xml/text file to hole the data.

You need to save the values on an external file(Settings.txt)

the problem is that i dont know the way to do it.


just a small example:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        My.Computer.FileSystem.WriteAllText("myText.txt", TextBox1.Text & "#", True)
    End Sub

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            For Each line As String In My.Computer.FileSystem.ReadAllText("myText.txt").Split("#")
        Catch ex As system.IO.FileNotFoundException
            'file doesnt exist yet
        End Try
    End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.