2011-04-01 5 views
0

내 필요에과가 ... 텍스트가 backroung 색상에서, 보이지 않는 색깔의 도착 때 cxgrid 행 색상 투명

어떻게 텍스트 색상을 변화에 따라 빨간색으로 그리드의 행의 색상을 변경하고있어 나 투명하게 만들까요 ???

void __fastcall TfRegular::tvFillOutCustomDrawCell(TcxCustomGridTableView *Sender, 
      TcxCanvas *ACanvas, TcxGridTableDataCellViewInfo *AViewInfo, 
      bool &ADone) 
{ 
    TRect ARec; 
    ARec=AViewInfo->Bounds; 

     //AViewInfo->GridRecord->DisplayTexts[7]="+" + AViewInfo->GridRecord->DisplayTexts[7]; 

// ShowMessage(AViewInfo->GridRecord->Values[13]); 
    if (AViewInfo->GridRecord->Values[13]>1) { 
     ACanvas->Canvas->Brush->Color = clRed; 
     ACanvas->Canvas->Font->Color = clBlack; 
     ACanvas->Canvas->Pen->Color = clRed; 
     ACanvas->Canvas->FillRect(ARec); 
     SetBkMode(ACanvas->Canvas->Handle,TransparentColor); 

      //InflateRect(AViewInfo->Bounds,2,2); 
     //ACanvas->DrawTexT("",AViewInfo->Bounds,0); 

     ADone=true; 
    } 


} 

답변

0

나는 생각보다 쉽습니다.

OnGetContentStyle 이벤트를 사용하여이 문제를 해결했습니다.