리스트뷰에서 특정컬럼의 색깔을 변경하려면 CustomDrawSubItem 멤버함수에
인자로 들어오는 SubItem을 구분하면서 Canvas의 폰트색을 변경해주면 됩니다..
이 소스를 보세여... 매우 간단합니다...
procedure TRstPreview.ListView1CustomDrawSubItem(Sender: TCustomListView;
Item: TListItem; SubItem: Integer; State: TCustomDrawState;
var DefaultDraw: Boolean);
begin
if SubItem = 1 then
begin
TListView(Sender).Canvas.Font.Color := clGreen;
DefaultDraw := True;
exit;
end;
if SubItem = 2 then
begin
TListView(Sender).Canvas.Font.Color := clLime;
DefaultDraw := True;
exit;
end;
if SubItem = 3 then
begin
TListView(Sender).Canvas.Font.Color := clPurple;
DefaultDraw := True;
exit;
end;
end;
즐델하셔염......
아참... 위 소스에서 SubItem의 인덱스는 ListView1.SubItems[0] 이 SubItem = 1 이군요....
꼴통 님이 쓰신 글 :
: 안넝하세여~~
: ListView의 각각의 컬럼에 Color를 넣어야 되는되
: 원래 없는건지 있으면 좀 갈켜 주시면 감쌰 하겠씸다
:
: 그리고 DBGrid에서 DB연결안하고 컬럼에 값을 넣을수는 없을까요??
:
|