Hi,
The code below selects all items in a listview control,fine,but I was
wondering how I could code to select all but the very last line in the array.
Private Sub SelectAllToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SelectAllToolStripMenuItem1.Click
Dim i As Integer
Dim lvItm As ListViewItem
Dim str(2) As String
Dim oWrite As System.IO.StreamWriter
oWrite = System.IO.File.CreateText(Me.Text.ToString & ".txt")
For Each lvItm In ListView2.Items
str(0) = lvItm.SubItems.Item(0).Text.ToString
str(1) = lvItm.SubItems.Item(1).Text.ToString
str(2) = lvItm.SubItems.Item(2).Text.ToString
oWrite.WriteLine(str(0) & vbTab & str(1) & vbTab & str(2))
Next
oWrite.Close()
''''''''''''''''''''''''''''''''''''''''''''''''
' This Code Selects all in listView control
''''''''''''''''''''''''''''''''''''''''''''''''
For i = 0 To ListView2.Items.Count.ToString - 1
ListView2.Items(i).Selected = True
ListView2.Select()
Next
End Sub
Cheers & Best Regards