核心提示:procedure TMainForm.AllDrawGridClick(Sender: TObject);var Rect: TRect;begin Rect:=TDrawGrid(Sender)....
procedure TMainForm.AllDrawGridClick(Sender: TObject);
var
Rect: TRect;
begin
Rect:=TDrawGrid(Sender).CellRect(TDrawGrid(Sender).Col,TDrawGrid(Sender).Row);
TDrawGrid(Sender).Canvas.Pen.Color := clFuchsia;
TDrawGrid(Sender).Canvas.Pen.Width:=2;
TDrawGrid(Sender).Canvas.MoveTo(Rect.Left, Rect.Top);
TDrawGrid(Sender).Canvas.LineTo(Rect.Right, Rect.Top);
TDrawGrid(Sender).Canvas.MoveTo(Rect.Left, Rect.Top);
TDrawGrid(Sender).Canvas.LineTo(Rect.Left, Rect.Bottom);
TDrawGrid(Sender).Canvas.MoveTo(Rect.Right, Rect.Top);
TDrawGrid(Sender).Canvas.LineTo(Rect.Right, Rect.Bottom);
TDrawGrid(Sender).Canvas.MoveTo(Rect.Left, Rect.Bottom);
TDrawGrid(Sender).Canvas.LineTo(Rect.Right, Rect.Bottom);
end;