|

楼主 |
发表于 2008-5-21 16:46:47
|
显示全部楼层
我的代码是这样的,我想判断某行某列的值小于200就把字体变成红色
代码如下:
procedure TMainForm.Button1Click(Sender: TObject);
var
lSheet: Business.Model.TSheetDoc;
i,j : integer;
begin
DataSetBroker1.DataSet.Open;
lSheet := TSheetDoc(DocViewTEST1_SJWG2.Doc);
for i:=3 to lSheet.RowCount-1 do
for j:=2 to lSheet.ColCount-3 do
begin
if strtoint(lSheet.Cells[j,i].astring) < 200 then
begin
lSheet.Cells[j,i].Font.Color := Graphics.clRed;
end;
end;
DocViewTEST1_SJWG2.Doc.Close;
DocViewTEST1_SJWG2.OpenView(TDocMode.dmEdit);
end |
|