starter 님이 쓰신 글 :
: delphi 프로그램 개발중인 초보개발자입니다.
: TcxDBTreeList의 데이터 표기될때... 짝수줄, 홀수줄의 row색상을 변경하고.... 포커스되는 data row의 색상을 변경하는 방법을 알고싶어서 글을 남깁니다...
: 제가 cxDBTreeListCustomDrawDataCell 이벤트에서 사용중인데..
:
: if AViewInfo.TreeList.Focused then
: begin
: ACanvas.Brush.Color := ~~;
: ACanvas.Font.Color := ~~;
: end
: else
: if odd(AViewInfo.RecordIndex) then
: begin
: ACanvas.Brush.Color := ~~;
: ACanvas.Font.Color := ~~;
: end
: else
: begin
: ACanvas.Brush.Color := ~~;
: ACanvas.Font.Color := ~~;
: end;
:
: 아래와 같은 방식으로..코딩중인데..
: 저건 정상적인게 아닌것 같고... 다른방법이 있을까요..ㅠ
Styles Property에 ContentEven, ContentOdd 에 색상 Style을 추가하면 색상변경 가능함.
Forcus는 기존 방식(cxDBTreeListCustomDrawDataCell )을 사용.
procedure TForm1.cxDBTreeList1CustomDrawDataCell(Sender: TcxCustomTreeList; ACanvas: TcxCanvas;
AViewInfo: TcxTreeListEditCellViewInfo; var ADone: Boolean);
begin
if AViewInfo.Focused then
ACanvas.Brush.Color := clLime
|