StringGrid第一行即标题栏怎么加上文字 就像数据库中的字段一样

解决方案 »

  1.   

    StringGrid1.Cells[0,0] := 'aaa';
      

  2.   

    for i:=0 to StringGird1.ColCount-1 do
    beign
      StringGrid1.Cells[i,0]:='...';
    end;
      

  3.   

    给我一个函数:
    procedure WriteStrGridFixedRow(var StrGrid:TStringGrid;const Fixedvalues:array of string);
    var i,j:integer;
    begin
         with StrGrid do
         begin
           colcount:=fixedcols+(high(fixedvalues)-low(fixedvalues)+1);
           for i:=fixedcols to colcount-1 do
              cells[i,0]:=fixedvalues[low(fixedvalues)+i-fixedcols];
         end;
         setstrGrid(StrGrid);     with strGrid do
         begin
           for i:=fixedrows to rowcount-1 do
             for j:=FixedCols  to colcount-1 do
               cells[j,i]:='';
         end;     StrGrid.Cells[0,0]:='序号';
         StrGrid.RowCount:=2;
    end;