É possivel colorir linha e coluna do DBGrid...
:wink: Olá Mentes Especiais!
:arrow: Sou estudante, e ainda estou aprendendo e tenho muito a aprender no Delphi, gostaria de dicas se existe algum comando ou código que seja possível colorir as linhas e colunas do DBGrid, No trabalho em grupo fique com a parte da configuração gráfica.
Desde já agradeço a ajuda!
Valeu Galera!!!
:arrow: Sou estudante, e ainda estou aprendendo e tenho muito a aprender no Delphi, gostaria de dicas se existe algum comando ou código que seja possível colorir as linhas e colunas do DBGrid, No trabalho em grupo fique com a parte da configuração gráfica.
Desde já agradeço a ajuda!
Valeu Galera!!!
Jfalexandre
Curtidas 0
Respostas
Lfernandos
20/02/2003
Vc pode usar o envento OnDrawColumnCell do DBGrid.
procedure TfrmComissao.DBGrid2DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
if Odd(Column.Index) then begin
TDBGrid(Sender).Canvas.Font.Color := clNavy;
TDBGrid(Sender).Canvas.Brush.Color := clInfoBk;
TDBGrid(Sender).DefaultDrawColumnCell(Rect,DataCol,Column,State);
end
else begin
TDBGrid(Sender).Canvas.Font.Color := clWindowText;
TDBGrid(Sender).Canvas.Brush.Color := clWindow;
TDBGrid(Sender).DefaultDrawColumnCell(Rect,DataCol,Column,State);
end;
end;
Este código cria um DBGrid Zebrado.
procedure TfrmComissao.DBGrid2DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
if Odd(Column.Index) then begin
TDBGrid(Sender).Canvas.Font.Color := clNavy;
TDBGrid(Sender).Canvas.Brush.Color := clInfoBk;
TDBGrid(Sender).DefaultDrawColumnCell(Rect,DataCol,Column,State);
end
else begin
TDBGrid(Sender).Canvas.Font.Color := clWindowText;
TDBGrid(Sender).Canvas.Brush.Color := clWindow;
TDBGrid(Sender).DefaultDrawColumnCell(Rect,DataCol,Column,State);
end;
end;
Este código cria um DBGrid Zebrado.
GOSTEI 0
Jfalexandre
20/02/2003
Obrigado Lfernando pela dica, vou testar agora mesmo!
Valeu!
Valeu!
GOSTEI 0