1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
procedure TFrmMeubles.ListView1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
pt: TPoint;
li : TLIstItem;
CurrentListView : TListView;
i : Integer;
begin
CurrentListView := TListView(Sender);
pt := CurrentListView.ScreenToClient(Mouse.CursorPos) ;
li := CurrentListView.GetItemAt(pt.x, pt.y) ;
//over a sub item?
if li = nil then
else
begin
// li.Canvas.Brush.Color := clFuchsia;
//li.ListView.Brush.Color := clHighlight;
with Sender as TListView do
begin
for I := 0 to Items.Count - 1 do
begin
if i = li.Index then
li.ListView.Canvas.Brush.Color := clHighlight
// li.ListView.Brush.Color := clHighlight
else
Items.Item[i].ListView.Canvas.Brush.Color := clWhite;
end;
end;
end;
end; |
Partager