2011-04-01 79 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事件解決了這個問題。