Headers.Add(ListViewSummary.Columns(i).Text)
Here is the code that I am using to save the Listview contents to the .txt file:
Private Sub SaveToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripButton.Click Dim filepath As String = My.Computer.FileSystem.SpecialDirectories.MyDocuments & "\listview.txt" Dim outputstream As New IO.StreamWriter(filepath) Dim s As Short Dim newstr(5) As String Dim I As Integer Dim Text1 As String Dim Text2 As String Dim Text3 As String Dim Text4 As String Dim Text5 As String Dim ItemCount As Integer ItemCount = Me.ListViewSummary.Items.Count For I = 0 To ItemCount - 1 For s = 0 To 4 newstr(s) = ListViewSummary.Items.Item(I).SubItems(s).Text Next Text1 = newstr(0) Text2 = newstr(1) Text3 = newstr(2) Text4 = newstr(3) Text5 = newstr(4) outputstream.WriteLine(Text1 & " / " & Text2 & " / " & Text3 & " / " & Text4 & " / " & Text5) Next I outputstream.Close() End Sub
Any suggestions are appreciated. Thanks!

New Topic/Question
Reply




MultiQuote




|