Items can be displayed in columns with column headers and sub-items, or vertically or horizontally, with small or large icons.
When the Checkboxes property is True, ListView includes a check box next to the items in the list.
To get the "checked" state for an item in the list view, read the Checked boolean property.
Check/Uncheck Does Not Select the ItemYou will notice that checking or unchecking the item in a list view will not change the selected item - the item that gets checked will not get selected.
If you need to have the item Selected when Checked, you need to handle the OnMouseDown even of the TListView:
//ListView OnMouseDownWith the above code for the OnMouseDown event handler, when an item is checked or unchecked it will get selected. Note: you can also notice that there's no event that you can handle when an item is checked or unchecked. The Implementing the On Item Checked Event for the TListView Control provides the code you can use to handle the item checked state change event.
procedure TForm.ListView1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
lv : TListView;
lv := TListView(Sender);
li := lv.GetItemAt(X, Y);
if (li <> nil) AND (lv.Selected <> li) then lv.Selected := li;
Delphi tips navigator:
» MultiSelect in TShellListView
« Scroll a Non-Focused Control Under the Mouse On Mouse Wheel Input