delphi dbgrid renklendirme

admin27.11.2008 - 10:31
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
  DataCol: Integer; Column: TColumn; State: TGridDrawState);

      var
Renk:Tcolor;
Renk1:Tcolor;

begin

begin
if (dbgrid1.datasource.dataset.recno mod 2) =0
      then DBGrid1.Canvas.Brush.Color := clBlue
      else DBGrid1.Canvas.Brush.Color := clRed;
       DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);


end;
    Renk:=DbGrid1.Canvas.Brush.color;
If Column.fieldname='Continent' then
If (Column.Field.Asstring ='North America') then
Begin
Dbgrid1.Canvas.Brush.Color:=Clwhite;
Dbgrid1.DefaultDrawColumnCell(Rect,Datacol,column, state);
Dbgrid1.Canvas.Brush.Color:=Renk;
End;





end;

end.


örnek program ektedir


Linkback: https://www.buyuknet.com/delphi-dbgrid-renklendirme-t11295.0.html

Etiket:
delphi dbgrid renklendirme 

Bu bilgi size yardimci oldu mu?

EvetHayır
delphi dbgrid renklendirme
delphi dbgrid renklendirme
(Ortalama: 5 üzerinden 2.5 - 2 Oy)
2