Unable to check/uncheck listview checkbox


I have a listview control with checkboxes. I am able to select any item by clicking on the text and the checkbox is checked/unchecked. However, when I attempt to select the item by clicking on the checkbox, I am unable to check/uncheck the text box.

Your help is appreciated.


Who is Participating?
Ryan ChongConnect With a Mentor Commented:
Glad you resolved your problem, since then i got 2 suggestions:

1. Post a request at Community Support to have a refund , or
2. Accept my comment as the Answer, ONLY if you think i did make some help here

cheers ;-)
Ryan ChongCommented:
Did you write scripts inside the ListView's ItemCheck Event ? Try check the script logic behind as you may check the checkbox while it's unchecked.

Post your scripts here if necessary, regards
welcomesAuthor Commented:
Thanks. I believe I finally got it working. FYI, here is the ItemCheck code...

Private Sub lstvwSector_ItemCheck(ByVal Item As MSComctlLib.ListItem)
    Dim i As Integer
    i = Item.index
    If lstvwSector.ListItems.Item(i).Checked = True Then
        lstvwSector.ListItems.Item(i).Checked = False
        lstvwSector.ListItems.Item(i).Checked = True
    End If
    lstvwSector.ListItems.Item(i).Selected = True
End Sub
All Courses

From novice to tech pro — start learning today.