Y yhl1118 Unregistered / Unconfirmed GUEST, unregistred user! 2001-01-06 #1 请问,有哪个控件可以定义某一个单元格的背景和字体的颜色, 而不是整个网格的背景和字体的颜色,如何实现
C Crab Unregistered / Unconfirmed GUEST, unregistred user! 2001-01-06 #2 手工控制: procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin if DataCol = 2 then begin DBGrid1.Canvas.Brush.Color := clPurple; DBGrid1.Canvas.FillRect(Rect); end; DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State); end;
手工控制: procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin if DataCol = 2 then begin DBGrid1.Canvas.Brush.Color := clPurple; DBGrid1.Canvas.FillRect(Rect); end; DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State); end;
B BaKuBaKu Unregistered / Unconfirmed GUEST, unregistred user! 2001-01-08 #4 EasyGrid. <a href="DispQ.asp?LID=433156">EasyGrid 已经上载到 robertcool.top263.net,需要的朋友可以免费下载!</a>