C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[36324] 리스트뷰 오너드로우
Builder MySelf [gozealot] 2021 읽음    2004-07-16 15:04
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할때 색갈이 먹질 않네요...

잘못된 부분이 있나요? 혹은 더 좋은 아이디어라도...

+ -

관련 글 리스트
36324 리스트뷰 오너드로우 Builder MySelf 2021 2004/07/16
36329     Re:리스트뷰 오너드로우 유영인 Cuperido 2899 2004/07/16
36330         Re:Re:리스트뷰 오너드로우 Builder MySelf 4838 2004/07/16
36331             Re:Re:Re:리스트뷰 오너드로우 유영인 Cuperido 2591 2004/07/16
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.