L
LitterTiger
Unregistered / Unconfirmed
GUEST, unregistred user!
TDBGrid如何使某一列的显示结果是自定义显示的?
在TDBGrid里On...Draw 事件中如果自己画,当一行被选中时,一个cell只有有字的地方的底色是深色,没有字的地方还是白色,真是不好看.
请问如何处理呢? TField好像也有个OnGetText事件不知道是否有帮助?
void __fastcall TForm1:BGrid1DrawDataCell(TObject *Sender,
const TRect &Rect, TField *Field, TGridDrawState State)
{
DBGrid1->Canvas->TextOutA(Rect.Left,Rect.top," test");
}
//---------------------------------------------------------------------------
void __fastcall TForm1:BGrid1DrawColumnCell(TObject *Sender,
const TRect &Rect, int DataCol, TColumn *Column,
TGridDrawState State)
{
if(State.Contains(gdFocused))
DBGrid1->Canvas->TextOutA(Rect.Left,Rect.top," test");
}
在TDBGrid里On...Draw 事件中如果自己画,当一行被选中时,一个cell只有有字的地方的底色是深色,没有字的地方还是白色,真是不好看.
请问如何处理呢? TField好像也有个OnGetText事件不知道是否有帮助?
void __fastcall TForm1:BGrid1DrawDataCell(TObject *Sender,
const TRect &Rect, TField *Field, TGridDrawState State)
{
DBGrid1->Canvas->TextOutA(Rect.Left,Rect.top," test");
}
//---------------------------------------------------------------------------
void __fastcall TForm1:BGrid1DrawColumnCell(TObject *Sender,
const TRect &Rect, int DataCol, TColumn *Column,
TGridDrawState State)
{
if(State.Contains(gdFocused))
DBGrid1->Canvas->TextOutA(Rect.Left,Rect.top," test");
}