i simple want when user click on the select all checkbox.all the checkboxes of list view should be filled with check sign.which is working fine.but problem is that when user click again on the checkbox .checksign still stay there.kindly let me know the idea any help would be highly appreciated.

Private Sub Check1_Click() 
Call SelectAll 
End Sub 
Private Function SelectAll() As Boolean 
    Dim Item As listitem 

    For Each Item In ListView1.ListItems 
        Item.Checked = True 
    Next 
  
    SelectAll = True 
End Function

Why not use a public boolean value as a toggle?

SelectedAll = NOT SelectedAll
Item.Checked = SelectedAll

Then the function can select and deselect all depending on the last state.

you need to check the status of the checkbox and change your code accordingly

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.