如附件:
11行4列的表格,边框为绿色,标题栏底纹为灰色,其他栏底纹为淡黄色,要怎么画出来呢?请知道的朋友指点一下好吗

解决方案 »

  1.   

    可以用stringgrid
    在onDrawCell事件里自己画,根据下面的自己调整一下  with jj_stg do begin
        if Arow=0 then   //标题栏
        bgein
          Canvas.Brush.Color:=clBtnFace;   //底色
          Canvas.pen.Color:=Font.Color;
          Canvas.fillRect(rect);
          Canvas.textout(rect.left+2,rect.top+2,jj_stg.Cells[acol,arow]);
        end
        else
        bgein              
          Canvas.Brush.Color:=clInfoBk;   
           Canvas.pen.Color:=Font.Color;
          Canvas.fillRect(rect);
          Canvas.textout(rect.left+2,rect.top+2,jj_stg.Cells[acol,arow]);
        end    if Arow=10 then
        begin
            Canvas.Pen.Width:=2;     
            Canvas.Pen.Color:=clGreen;
            Canvas.MoveTo(Rect.Left-1,Rect.Bottom-1);
            Canvas.LineTo(Rect.Right,Rect.Bottom-1);  //画绿色底框线
        end
      end