i, j: Integer;for i := 0 to StringGrid.Col do for j := 0 to StringGrid.Row do if StrToInt(StringGrid.Cell(j, i)) > 60 then ...(這裡是搞不定的,不支持著色操作)
StringGrid1->Canvas->Brush->Color=clYellow; StringGrid1->Canvas->FillRect(Rect); //if you want set font color , insert it here DrawText(StringGrid1->Canvas->Handle, StringGrid1->Cells[ACol][ARow].c_str(), -1,(RECT*)&Rect, DT_SINGLELINE | DT_VCENTER |DT_CENTER
for j := 0 to StringGrid.Row do
if StrToInt(StringGrid.Cell(j, i)) > 60 then
...(這裡是搞不定的,不支持著色操作)
StringGrid1->Canvas->FillRect(Rect);
//if you want set font color , insert it here
DrawText(StringGrid1->Canvas->Handle,
StringGrid1->Cells[ACol][ARow].c_str(),
-1,(RECT*)&Rect,
DT_SINGLELINE | DT_VCENTER |DT_CENTER