|
지난번에 글 올려서 해결했는데..
그동안 스트링 그리드가 아니라 디비그리드를 쓰다가 사정상 스트링 그리드를 써야하는데..
이건 어떻게 하는지 생각이 영..--;
암튼 게시판 뒤져서
void __fastcall TForm1::StringGrid1DrawCell(TObject *Sender, long Col, long Row, TRect &Rect, TGridDrawState State)
{
long index = ARow * StringGrid1->ColCount + ACol;
StringGrid1->Canvas->Brush->Color = ColorBox1->Selected;
StringGrid1->Canvas->FillRect(Rect);
ImageList1->Draw(StringGrid1->Canvas,Rect.Left,Rect.Top,index);
if (State.Contains(gdFocused))
StringGrid1->Canvas->DrawFocusRect(Rect);
}
이 코드를 찾았거든요..
근데 위의 처럼 했더니 셀의 색은 바뀌는데...
그 안의 글자가 보이지 않아서..
다시 글을 올렸더니..
StringGrid1->Canvas->Font->Color = clRed;
StringGrid1->Canvas->Font->Style = TFontStyles()<<fsBold;
를 추가하라고 나왔거든요..
그래서..
long index = ARow * StringGrid1->ColCount + ACol;
StringGrid1->Canvas->Brush->Color = ColorBox1->Selected;
StringGrid1->Canvas->Font->Color = clRed;
StringGrid1->Canvas->Font->Style = TFontStyles()<<fsBold;
StringGrid1->Canvas->FillRect(Rect);
ImageList1->Draw(StringGrid1->Canvas,Rect.Left,Rect.Top,index);
if (State.Contains(gdFocused))
StringGrid1->Canvas->DrawFocusRect(Rect);
이렇게 써 봤더니..
그래도 셀 안의 글자가 보이지 않거든요..
뭘 잘못한거죠..?
분명히 그때 이거 보고 제대로 되서 좋아한 적이 있는데..ㅜㅜ
|