Hi guys,

I am working on my listview which I have almost finish it, but i need to work on the button event to check for each string in the listview whether if the checkbox is true or false. When I tick and untick on the checkboxes to add the strings in the label, I want to know how i can check them out through on the listview to see if the checkbox is true or false?


Here's the code:

Code:
Private Function GetEnabledDisabledText(ByVal enabled As Boolean) As String
	Return (If(enabled, "Enabled", "Disabled"))
End Function

Private Shared subItems1 As New List(Of String)()

Private Sub listView1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
	Dim strItem As String = listView1.HitTest(e.Location).Item.SubItems(1).Text

	If subItems1.Contains(strItem) Then
	   subItems1.Remove(strItem)
	Else
	   subItems1.Add(listView1.HitTest(e.Location).Item.SubItems(1).Text)
	End If
	
	label3.Text = String.Join(", ", subItems1.ToArray())
End Sub

Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
	button1.Enabled = False
	Dim a() As String = Nothing
	a = label3.Text.Split(","c)
	Dim j As Integer = 0
	Dim str As Object = GetEnabledDisabledText(listView1.Items(j).Checked)
	MessageBox.Show(a(j).Trim() & " is " & str.ToString())
End Sub
Do you know how I can get the messagebox to display and tells me if the checkboxes in the listview compare to each string that I add in the label is true or false?

Can anyone help me with this?