É possivel colorir linha e coluna do DBGrid...
20/02/2003
0
: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
Curtir tópico
+ 0
Responder
Posts
20/02/2003
Lfernandos
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.
Responder
20/02/2003
Jfalexandre
Obrigado Lfernando pela dica, vou testar agora mesmo!
Valeu!
Valeu!
Responder
Clique aqui para fazer login e interagir na Comunidade :)