Herwig
Herwig

Reputation: 333

TListView & selection highlighting

Is there any (easy) way to suppress the blue selection of a selected TListView item (VCL)?

enter image description here

Upvotes: 1

Views: 1698

Answers (1)

Tom Brunberg
Tom Brunberg

Reputation: 21033

In the OnSelectItem() event, set Selected := False;. Alternatively also Focused:=False; for the Item parameter.

procedure TForm10.ListView1SelectItem(Sender: TObject; Item: TListItem;
  Selected: Boolean);
begin
//  item.Focused:=False;
  item.selected:=False;
end;

enter image description here

If you don't want to see the focus rectangle either, uncomment the first line in the code.

Upvotes: 3

Related Questions