|
스트링 그리드 글자 색 바꾸기 질문입니다.
셀의 값 조건에 따라 그 셀의 글자 색을 바꾸는
작업을 하고자 합니다.
아래 루틴을 FormShow에 넣었더니
색이 바뀌지 않고
OnDrawCell에 넣으면 바뀌는 것은 같은데
반응이 너무 늦습니다.
방법이 있을까요?
float A;
TRect TheRect;
for(int Row=0; Row<10; Row++)
{
A=sin(Row);
B=cos(Row)*sin(Row);
StringGrid1->Cells[0][Row+1]=A;
StringGrid1->Cells[1][Row+1]=B;
if(A>0.5)
{
StringGrid1->Cells[2][Row+1]="1";
}
else
{
TheRect= StringGrid->CellRect(1,Row+1);
StringGrid1->Canvas->Font->Color = clMaroon;
StringGrid1->Canvas->TextOut(TheRect.Left + 2, TheRect.Top + 2,"FAIL");
}
}
|