delphi2007 教程

delphi2007 教程

首页 新随笔 联系 聚合 管理
  1013 Posts :: 0 Stories :: 28 Comments :: 0 Trackbacks
求在网格里显示图片的方案 VCL组件开发及应用
http://www.delphi2007.net/DelphiVCL/html/delphi_20061222161956180.html
在ListView或StringGrid或其他里都行  
  要求能显示多个单元,  
  上面是图片,图片地址为:http://www.com.com/aa.jpg  
  下面是复选框,  
  能定位到单元,从头到尾循环,  
  如果选择了下面的复选框,  
  做些相应的处理  
  ---------------------------------  
  |   图片1   |   图片1   |   图片1   |   图片1   |  
  |复选框1|复选框1|复选框1|复选框1|  
  ---------------------------------  
  |   图片1   |   图片1   |   图片1   |   图片1   |  
  |复选框1|复选框1|复选框1|复选框1|  
  ---------------------------------  
  |   图片1   |   图片1   |   图片1   |   图片1   |  
  |复选框1|复选框1|复选框1|复选框1|  
  ---------------------------------

基本语句是这样的:  
   
  procedure   TForm1.StringGrid1DrawCell(Sender:   TObject;   ACol,   ARow:   Integer;  
      Rect:   TRect;   State:   TGridDrawState);  
  begin  
      if   (ACol   =   1)   and   (ARow   =   1)   then  
      begin  
          StringGrid1.RowHeights[ARow]   :=   Image1.Picture.Graphic.Height;  
          StringGrid1.ColWidths[ACol]   :=   Image1.Picture.Graphic.Width;  
          StringGrid1.Canvas.Draw(Rect.Left,   Rect.Top,   Image1.Picture.Graphic);  
      end;  
  end;  
   
  完整的功能实现,你自己琢磨一下吧。

posted on 2008-11-18 14:29 delphi2007 阅读(343) 评论(0)  编辑 收藏 引用
只有注册用户登录后才能发表评论。