如何在stringGrid里显示图片,100分相赠!要求是当用户单击这个grid是显示图片
当用户移开时不消失

解决方案 »

  1.   

    把DefaultDrawing设置为true
    然后OnDrawCell事件画上你的图片就是了
      

  2.   

    例如
    procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TGridDrawState);
    begin
      StringGrid1.Canvas.StretchDraw(StringGrid1.CellRect(ACol,ARow),Image1.Picture.Bitmap);
    end;
      

  3.   

    procedure TForm4.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TGridDrawState);
    begin
      with StringGrid1.Canvas do 
    Draw(Rect.Left, Rect.Top, Image1.Picture.Graphic); 
    end;stringGrid改变颜色或是其他的。。都是画上去的。所以画完还要把字写上去!才算结束!
    不知道你要的是什么效果!