Code: Select all
procedure TfStory.RVMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
P: TPoint;
Row, Col: Integer;
I, J: Integer;
begin
for I := 0 to ATable.Rows.Count do
for J := 0 to ATable.Rows[I].Count - 1 do
if ATable.Cells[I, J] <> Nil then
ATable.Cells[I, J].Color := clWhite;
P := RV.ScreenToClient(Mouse.CursorPos);
ATable.GetCellAt(P.X, P.Y, Row, Col);
ATable.Cells[Row, Col].Color := clRed;
end;
1- Does such use of RVMouseMove is correct? I considered that it dosen't work if user move the mouse over an empty area in cell.
2- It raise an List Bounds exception in following line:
Code: Select all
ATable.Cells[I, J].Color := clWhite;
Thank you