:wave:
I used a ListView (view=lvwReport) with CheckBoxes which allow multi-selection. Then I need to know how to detect which rows were selected by the user ?
Thank you in advance.
Printable View
:wave:
I used a ListView (view=lvwReport) with CheckBoxes which allow multi-selection. Then I need to know how to detect which rows were selected by the user ?
Thank you in advance.
try this:
HarshVB Code:
Private Sub Command1_Click() Dim i%, rowCount$ For i = 1 To ListView1.ListItems.count If ListView1.ListItems.Item(i).Checked = True Then rowCount = rowCount & CStr(ListView1.ListItems.Item(i).Index) & " " End If Next MsgBox "Rows " & rowCount & " are checked" End Sub Private Sub Form_Load() ListView1.ListItems.Add 1, , "Item 1" ListView1.ListItems.Add 2, , "Item 2" ListView1.ListItems.Add 3, , "Item 3" End Sub
Harsh,
It worked in my project, thank you very much. :thumb:
But can you tell what is the difference between "Listview1.ListItem." and "Listview1.ListItems." ?
ListItems is a collection of ListItem objects.
OR
ListItem object is part of ListItems collection.
But both deinitions are the same things.
:ehh: are you sure you are getting something like ListView1.Listitem. (without s), because here on my pc, it is only showing ListView1.ListItems.Quote:
Originally Posted by JohnAtom
BTW, i am using VB 6 SP 6 on win 98. probably again something difference working on 98 and NT based?? :confused: :/
please do post if or not i am wrong.
thank you
Harsh,
I develop my project using VB6 SP6 in a XP machine, there are Listitem and Listitems.