Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I have a listview with two colomns name surname i need to retrieve the name of the checked person ,with this code i can retrieve the index but not text please help, i need to retriev text and display it on msgbox

VB
Dim i As Integer
     For i = 0 To listview1.Items.Count - 1

         If listview1.Items(i).Checked = True Then
             MessageBox.Show(i)
         End If

     Next i
Posted

1 solution

You would want to access the ListView`s Items property at the index of (i) to get the correct ListViewItem in order to display its Text property.

VB
MessageBox.Show(ListView1.Items(i).Text)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900