Fórum Linhas Coloridas no String Grid #233056
19/05/2004
0
desde já obrigado! :wink:
Btovix
Curtir tópico
+ 0Posts
19/05/2004
Fabio.hc
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin if Query1Campo.Value = ´Debito´ then // coloque aqui sua condição DBGrid1.Canvas.Font.Color:= clRed // coloque aqui a cor desejada else DBGrid1.Canvas.Font.Color:= clBlue; // coloque aqui a cor desejada DBGrid1.DefaultDrawDataCell(Rect, DBGrid1.columns[datacol].field, State); end;
Gostei + 0
19/05/2004
Btovix
Mesmo assim brigadão cara! Se vc ou mais alguém souber como eu posso alterar esses valores eu agradeço! []´s a todos! :wink:
Gostei + 0
20/05/2004
Licabh
No evento onDrawCell do stringgrid,
procedure TfrmAgendaRc.stgDrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
var
i, j:Integer;
{***}
procedure DrawCellText;
var
Text: array[0..255] of Char;
begin
StrPCopy( Text, stg.Cells[ ACol, ARow ] );
ExtTextOut( stg.Canvas.Handle, Rect.Left + 2, Rect.Top + 2,
ETO_CLIPPED or ETO_OPAQUE, @Rect, Text, StrLen( Text ),nil );
end;
{***}
procedure DrawCellColor( CorLetra : TColor );
begin
with stg.Canvas do
begin
{pinta as letras com a cor desejada}
Font.Color := CorLetra;
DrawCellText;
end;
end;
{***}
begin
for i := 1 to stg.RowCount do
begin
j := pos(IntToStr(i), Linhas);
// Nesta variável linha, coloque as linhas que possuem o conteudo que
// vc deseja verificar
if J > 0 then
if stg.Cells[0, i] <> ´´ then
if (ARow = i) then
DrawCellColor( clRed );
end;
end;Espero que tenha ajudado.
][´s Aline[/code]
Gostei + 0
21/05/2004
Btovix
Gostei + 0
27/05/2004
Oziasl
qual as instruções você usou para resolver o problema. Estou com esse problema também. ozias
Gostei + 0
27/05/2004
Oziasl
como faço pegar o seu código, referente a esse assunto. Estou com esse problema também. Ozias
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)