请问怎样修改Vcl中的clear方法(或者重新定义一个)才能使这个功能不清除第一列,因为我的第一列是序号。
如果是用象清空cell的方法,请不要跟贴。

解决方案 »

  1.   

    你自己不要清第一列不就行了。
    當i=0時不要執行﹕Row[i].clear﹔
      

  2.   

    你用CELLS[3,3].TEXT:=''来清空好了,别用CLEAR
      

  3.   

    清空前﹐先保存第一列的值
    清空后﹐再給第一列付值。
    str:=cells[0,i];
    row[i].clear;
    cells[0,i]:=str;
      

  4.   

    CLEAR方法不能重载。先保存,后面再重新恢复那个值吧。
      

  5.   

    作个循环,不包括第一行
      for iRow := 1 to sgProduct.RowCount do
      begin
        sgProduct.Rows[iRow].Clear();
        sgProduct.Cells[0, iRow] := inttostr(iRow);
      end;
      

  6.   

    For iCol := 1 to StringGrid.ColCount - 1 do
      For iRow := 0 to StringGrid.RowCount - 1 do
        StringGrid.Cellls[iCol,iRow] := '';----------------
    沉沦中..........