|
색깔이 먹지 않는 다는 것은 아래 clLtGray 와 clBlack를 말씀하시는 것인지요?
아래 소스를 그대로 컴파일 해서 동작하였을때는 제대로 잘 동작을 하는 것 같아 보입니다
(선택되었을때 Font Size가 조금 틀려지는 것만 빼고는요)
다른 문제에서 안되는 것은 아닐까요? :)
cuperido
Builder MySelf 님이 쓰신 글 :
: void __fastcall TMainForm::lvEventCustomDrawItem(TCustomListView *Sender, TListItem *Item, TCustomDrawState State, bool &DefaultDraw)
: {
: AnsiString ItemCaption = "";
:
: if (State.Contains(cdsSelected))
: {
: //lvEvent->Canvas->Font->Color = clDkGray;
: //lvEvent->Canvas->Brush->Color = clInfoBk;
:
: TRect Rect = Item->DisplayRect(drBounds);
:
: lvEvent->Canvas->Brush->Color = clInfoBk;
: lvEvent->Canvas->FillRect(Rect);
:
: lvEvent->Canvas->Font->Size = 13;
: lvEvent->Canvas->Font->Color = clDkGray;
: lvEvent->Canvas->Font->Name = "굴림";
: }
: else
: {
: ItemCaption = Item->Caption;
:
: if (ItemCaption == "NEXT")
: {
: lvEvent->Canvas->Font->Color = clYellow;
: lvEvent->Canvas->Brush->Color = clGreen;
: }
: else if (ItemCaption == "TAKE")
: {
: lvEvent->Canvas->Font->Color = clYellow;
: lvEvent->Canvas->Brush->Color = clBackground;
: }
: else if (ItemCaption == "START")
: {
: lvEvent->Canvas->Font->Color = clDkGray;
: lvEvent->Canvas->Brush->Color = clAqua;
: }
: else
: {
: TDateTime now = now.CurrentDateTime();
: TDateTime dt = GetDateTime(Item->SubItems->Strings[5]);
:
: // 현재 시간을 기준으로 前은 밝은회색, 後는 바탕색의 보색
: if (dt != TDateTime(0))
: {
: if (dt <= now)
: lvEvent->Canvas->Font->Color = clLtGray;
: else
: lvEvent->Canvas->Font->Color = clBlack;
: }
: }
: }
:
: DefaultDraw = true;
: }
: //---------------------------------------------------------------------------
:
:
: 리스트뷰를 오너드로우로 그린것인데요...
:
: Selected할때 색갈이 먹질 않네요...
:
: 잘못된 부분이 있나요? 혹은 더 좋은 아이디어라도...
|