Link to home
Start Free TrialLog in
Avatar of chriseden
chriseden

asked on

Bitmaps in StringGrid

I understand that Bitmaps can be displayed in a cell of a Stringgrid, How ??

i have tried using 'objects' method, but I get an error message that I have not seen in a documentation 'EStringSparseListError'

can anyone suggest some code  ?
ASKER CERTIFIED SOLUTION
Avatar of ZifNab
ZifNab

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Maybe this will help???


procedure TForm1.StringGrid1DrawCell(Sender: TObject; Col, Row: Longint;
  Rect: TRect; State: TGridDrawState);
 
begin
  if StringGrid1.Objects[Col,Row] is TImage then begin
    with StringGrid1.Canvas do begin
      Draw(Rect.Left, Rect.Top, (StringGrid1.Objects[col,row] as TImage).Picture.Graphic);        {
    end;

  end;
end;


Avatar of chriseden
chriseden

ASKER

Great