edusabrz
asked on
vb6 ListView1 = ListView2
Hi There,
I have this form in VB6 in which I have several ListViews. Turns out that I have a For/Next loop to run in each one of those listviews, however I did not want to have to rewrite the loop for each one of the listview. So, I am now trying to find a way to create a method/function in which I pass the ListView control to, run the loop in the items in that list, performing the changes as necessary such as checking on/off the check box, and then returning the revewed listview back from that function.
Something like....
Private Function ChangeListView(lvwX as ListView) as ListView
For i = 1 To lvwX.ListItems.Count
if lvwX.ListItems(i).Text = "abc" then
lvwX.ListItems(i).Checked = True
end if
Next i
End Function
Then I would do....
ListView1 = ChangeListView(ListView1)
Everything goes well until I return from my function with my changed listview. I won't let me make the ListView1 = My new Listview
Suggestions?!
Thx a bunch..
Ed.
I have this form in VB6 in which I have several ListViews. Turns out that I have a For/Next loop to run in each one of those listviews, however I did not want to have to rewrite the loop for each one of the listview. So, I am now trying to find a way to create a method/function in which I pass the ListView control to, run the loop in the items in that list, performing the changes as necessary such as checking on/off the check box, and then returning the revewed listview back from that function.
Something like....
Private Function ChangeListView(lvwX as ListView) as ListView
For i = 1 To lvwX.ListItems.Count
if lvwX.ListItems(i).Text = "abc" then
lvwX.ListItems(i).Checked = True
end if
Next i
End Function
Then I would do....
ListView1 = ChangeListView(ListView1)
Everything goes well until I return from my function with my changed listview. I won't let me make the ListView1 = My new Listview
Suggestions?!
Thx a bunch..
Ed.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.