請問在stringgrid中修改某一列的值,另一列值可以change嗎?如何實現?

解决方案 »

  1.   

    什么意思,你直接改就行了阿
    stringsgrid.cols[i].clear;
      

  2.   

    在Tstringgrid的onkeypress事件实现的例子:
        if     key=#13      then
         begin
        if  (yzcol=9)  and  (stringgrid1.Cells[9,yzrow]<>'') and  (stringgrid1.Cells[10,yzrow]<>'')      then
              begin
                stringgrid1.Cells[11,yzrow]:=format('%.2f',[strtofloat(floattostr(strtofloat(stringgrid1.Cells[9,yzrow])*strtoint(stringgrid1.Cells[10,yzrow])))]);
                edit5.Text:=format('%.2f',[(strtofloat(edit5.Text)+strtofloat(stringgrid1.Cells[11,yzrow]))]);
              end;
           if  (yzcol=10) and (stringgrid1.Cells[9,yzrow]<>'') and  (stringgrid1.Cells[10,yzrow]<>'')   then
              begin
               stringgrid1.Cells[11,yzrow]:=format('%.2f',[strtofloat(floattostr(strtofloat(stringgrid1.Cells[9,yzrow])*strtoint(stringgrid1.Cells[10,yzrow])))]);
               edit5.Text:=format('%.2f',[(strtofloat(edit5.Text)+strtofloat(stringgrid1.Cells[11,yzrow]))]);
              end;
      

  3.   

    to:kl2000
    如果我修改了它,我不回車那段碼不白寫了嗎?它都不去執行呀
      

  4.   

    你还可以在onMouseMove写上代码!最好把计算的写成一个涵数!
       在上面的事件中调用涵数不就行了吗?
      

  5.   

    你有"if     key=#13      then"這一句呀
      

  6.   

    你用你的计算列作为条件不就得了吗?还有在ONKeyUp也放上你的涵数就OK了!
      

  7.   

    天外有天:我也是没有事情做,帮你测试一下,直接放在ONKeyUp事件就得了。