有没有人用过TDrawGrid  么在给定的cell里draw颜色呢?比如从第i1-i2行到j1-j2列填颜色??怎么做啊?

解决方案 »

  1.   

    学会看Help
    procedure TForm1.DrawGrid1DrawCell(Sender: TObject; Col, Row: Longint; Rect: TRect; State: TGridDrawState);var
      index: integer;
    begin
      index := Row * DrawGrid1.ColCount + Col;
      with Sender as TDrawGrid do
      begin
        Canvas.Brush.Color := clBackGround;
        Canvas.FillRect(Rect);
        ImageList1.Draw(Canvas,Rect.Left,Rect.Top,index);
        if gdFocused in State then
          Canvas.DrawFocusRect(Rect);
      end;end;