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

델파이 Q&A
Delphi Programming Q&A
[3050] [답변] LCI4616/ ListBox color
grcsb [ ] 1224 읽음    1998-05-31 08:39
전에 제가 태스트할 때 몰라서..
아주 무식한 방법을 알려드렸었는데요..
불현듯 생각나서 해보니..
역시 제가 몬가 빠트렸더군요..
ComboBox의 OnDrawItem이라는 Event를 이용하시되..
Style 프로퍼티를 csOwnerDrawVariable로 선택하세요..
소스는 아래와 같습니다..
공백마다 분리하는 것은 직접해보세요..

From 류..

---------

procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
Var
   iFont : Integer;
   stTemp : String;
begin
  // Style 프로퍼티를 csOwnerDrawVariable로 선택하세요..
  With TComboBox(Control) do
    Begin
      stTemp:= Items.Strings[Index];
      Canvas.Font.Color:= clRed;
      iFont:= 3;
      Canvas.TextOut(Rect.Left+iFont, Rect.Top, Copy(stTemp, 1, 3));
      iFont:= iFont+Canvas+TextWidth(Copy(stTemp, 1, 3));
      Canvas.Font.Color:= clNavy;
      Canvas.TextOut(Rect.Left+iFont, Rect.Top, Copy(stTemp, 4, 7));
    End;
end;



+ -

관련 글 리스트
3050 [답변] LCI4616/ ListBox color grcsb 1224 1998/05/31
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.