How to remove subitems in the label?
Hi guys,
I am currently working on my program to click on the listview items. I'm using listview mouseclick event to click on each listview item, I would like to know how I can get the messagebox to display to let me know that the subitems get remove in the label when I click on same checkboxes after when I add the subitems in the label?
Here's the code:
Code:
Private Sub listView1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
Dim item As String = listView1.HitTest(e.Location).Item.SubItems(1).Text
Dim a() As String = Nothing
a = label1.Text.Split(","c)
If label1.Text = "" Then
label1.Text = item
Else
If checkeditem.Checked = False Then
MessageBox.Show(a(j).Trim())
label3.Text &= ", " & item
Else
If Not(label3.Text.Contains(item)) Then
MessageBox.Show("add it")
Else
MessageBox.Show("remove it")
End If
End If
End If
End Sub
Any advice would be much appreciated
Thanks,
PillKilla