Nparag
December 28th, 1999, 01:17 PM
Hi everybody
can i select multiple columns or rows from a listview.
Actually what i want to do is i want to select multiple rows or columns from a listview and extract the selected rows/columns in some array and perform some operations on those values.
thanx in advance
Leonid Shraybman
December 29th, 1999, 12:41 AM
Hi.
Selection of multiple rows is possible. Here is a sample code on how to do it. If you have other questions e-mail me at las1@home.com
option Explicit
private Sub cmdOk_Click()
Dim i as Integer
Dim t as string
for i = 1 to lvwList.ListItems.Count
If lvwList.ListItems.Item(i).Selected = true then
t = lvwList.ListItems.Item(i).Text + _ lvwList.ListItems.Item(i).SubItems(1) + _ lvwList.ListItems.Item(i).SubItems(1)
End If
next
End Sub
private Sub Form_Load()
With lvwList.ListItems.Add(, , "Test1")
With .ListSubItems.Add(, , "Test1.2")
End With
With .ListSubItems.Add(, , "Test1.3")
End With
End With
With lvwList.ListItems.Add(, , "Test2")
With .ListSubItems.Add(, , "Test2.2")
End With
With .ListSubItems.Add(, , "Test2.3")
End With
End With
With lvwList.ListItems.Add(, , "Test3")
With .ListSubItems.Add(, , "Test3.2")
End With
With .ListSubItems.Add(, , "Test3.3")
End With
End With
With lvwList.ListItems.Add(, , "Test4")
With .ListSubItems.Add(, , "Test4.2")
End With
With .ListSubItems.Add(, , "Test4.3")
End With
End With
With lvwList.ListItems.Add(, , "Test5")
With .ListSubItems.Add(, , "Test5.2")
End With
With .ListSubItems.Add(, , "Test5.3")
End With
End With
With lvwList.ListItems.Add(, , "Test6")
With .ListSubItems.Add(, , "Test6.2")
End With
With .ListSubItems.Add(, , "Test6.3")
End With
End With
End Sub