RE: Znalec Delphi-stringgrid (drawgrid)

From: Snehulak <snehulak (zavinac)>
Date: 18. 10. 2004, 13:16 CEST
No a napovedu jsi zkousel ? :)

Pristupujes tam klasicky pres canvas.

The following code uses the bitmaps in an imagelist component to draw
the contents of each cell in a draw grid.  It draws a focus rectangle
around the cell that has focus.

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;


Snehulak 
Received on Mon, 18 Oct 2004 13:16:44 +0200

This archive was generated by hypermail 2.1.8 : 18. 10. 2004, 13:15 CEST