1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| procedure TForm1.StringGrid1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
StringGrid1.Invalidate;
end;
procedure TForm1.StringGrid1DrawCell(Sender: TObject; aCol, aRow: Integer;
aRect: TRect; aState: TGridDrawState);
var
Pt:TPoint;
begin
if aState*[gdFixed,gdSelected]=[] then
begin
Pt:=StringGrid1.ScreenToClient(Mouse.CursorPos);
if PtInRect(aRect,Pt) then
begin
StringGrid1.Canvas.Brush.Color:=clYellow;
StringGrid1.DefaultDrawCell( aCol, aRow, aRect,aState);
StringGrid1.Canvas.Brush.Color:=StringGrid1.Color;
Exit;
end;
end;
StringGrid1.DefaultDrawCell( aCol, aRow, aRect,aState);
end; |
Partager