ei guys, i am stuck in getting unchecked in listview... pls help me... thank u :) this is my code...

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        For Each item As ListViewItem In ListView1.Items
            If CheckState.Unchecked Then
                MsgBox(ListView1.Items.Item(0).SubItems(1).Text)
           End If
        Next

    End Sub

Hi,

You should try something like this:

Dim item As ListItem
	For Each item In ListView1.ListItems
		If item.Selected = False Then
			'do your stuff here
		End If
	Next

CheckState.Unchecked is not about the individual items.

For Each item As ListViewItem In ListView1.Items
            If item.Checked = False Then '// check if Not Checked.
                MsgBox(item.SubItems(1).Text) '// get value of "item" .SubItems(1).
            End If
        Next
commented: thank u :) +1

Thank you to all..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.