How to detect a click on the CheckBox in the TListView

Viewed 3077

So basically when a user clicks on the checkbox, I want to add that item in my list, I have tried using the OnChange event but this is not working for me as it gets fired even when the Checkbox is not clicked.

My code is simple and straightforward

procedure LvUserChange(Sender: TObject; Item: TListItem;Change: TItemChange);
 var
 objUser : TUsers;
begin
   if not assigned(objListOfChangedUsers) then
   objListOfChangedUsers := TObjectList.Create;

   objUser := Item.Data;
   objListOfChangedUsers.Add(objUser);
end;

I want this code to be fired ONLY when the checkbox is clicked in the ListView

2 Answers
Related