Drawing BMPs in TStringGrids cells  

Send By: Q3 Team
Web : http://www.q3.nu
Email: dlib@q3.nu
Date: 21/12/99

Tip accessed 649 times

 


For example, to put Image1 in cell 2,3:

  • Put this code into OnDrawCell event:


     procedure TForm1.StringGrid1DrawCell(Sender: TObject; Col, Row: Integer;
       Rect: TRect; State: TGridDrawState);
     begin
       if (Row=2) and (Col=3) then
         with StringGrid1.Canvas do
           Draw(Rect.Left, Rect.Top, Image1.Picture.Graphic);
     end;