title: writing content of listbox to a txt file and then opening it
body: <p>I am trying to save the contents of one listbox into a txt file and then open that up and printing it to a second listbox. i have done most of this, but my actual file is not a txt file. Can u show me how i make the file to be a txt file using my code? if this is not possible can u show me a code that can?</p>
  
  <pre><code>Private Sub LoadButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadButton.Click
      If OpenFD.ShowDialog() = DialogResult.OK Then
          Dim lines = File.ReadAllLines(OpenFD.FileName)
          ListBox2.Items.Clear()
          ListBox2.Items.AddRange(lines)
      End If
  End Sub
  
  Private Sub SaveButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveButton.Click
      If SaveFD.ShowDialog() = DialogResult.OK Then
          Using Writer = New StreamWriter(SaveFD.FileName)
              For Each o As Object In ListBox1.Items
                  Writer.WriteLine(o)
              Next
          End Using
      End If
  End Sub
  </code></pre>