Wilson, obrigada pela dica.

Vanessa Oliveira

2009/1/14 Wilson, Stephen <stephen.wil...@ipswichhospital.nhs.uk>

>   Ola Vanessa
>
> Nao estou familiarizado com Delphi 2007, mas este código poderia dar lhe
> uma dica:
>
> procedure TMainForm.DBG1DrawColumnCell(Sender: TObject; const Rect: TRect;
> DataCol: Integer; Column: TColumn; State: TGridDrawState);
> begin
> if gdSelected in State then // quando a linha esta selecionada
> begin
> (Sender as TDBGrid).Canvas.Brush.Color := $91B9B6
> (Sender as TDBGrid).Canvas.Font.Style:=[fsBold];
> (Sender as TDBGrid).Canvas.Font.Color:= $010101;
> end
> else // outros criterios
> try
> if ((Sender as
> TDBGrid).DataSource.DataSet.FieldByName('Priority').AsInteger = 2) then
> begin
> if daysDiff(date, (Sender as
> TDBGrid).DataSource.DataSet.FieldByName('DateIn').AsDateTime) >=28 then
> (Sender as TDBGrid).Canvas.Brush.Color := $A5A5EF
> else
> if daysDiff(date, (Sender as
> TDBGrid).DataSource.DataSet.FieldByName('DateIn').AsDateTime) >=14 then
> (Sender as TDBGrid).Canvas.Brush.Color := $0052E3F4; // $0052E3F4
> end
> else
> if ((Sender as
> TDBGrid).DataSource.DataSet.FieldByName('Priority').AsInteger = 1) then
> begin
> if daysDiff(date, (Sender as
> TDBGrid).DataSource.DataSet.FieldByName('DateIn').AsDateTime) >=7 then
> (Sender as TDBGrid).Canvas.Brush.Color := $A5A5EF // $5555FF
> else
> if daysDiff(date, (Sender as
> TDBGrid).DataSource.DataSet.FieldByName('DateIn').AsDateTime) >=4 then
> (Sender as TDBGrid).Canvas.Brush.Color := $0052E3F4;
> end
> except on EConvertError do
> end;
> (Sender as TDBGrid).DefaultDrawColumnCell(Rect, DataCol, Column, State);
> end;
>
> Espero que isso possa ajudar .....
>
> Steve
>
>
> -----Original Message-----
> From: delphi-br@yahoogrupos.com.br <delphi-br%40yahoogrupos.com.br>
> [mailto:delphi-br@yahoogrupos.com.br <delphi-br%40yahoogrupos.com.br>]On
> Behalf Of Vanessa Oliveira
> Sent: 13 January 2009 17:24
> To: delphi-br@yahoogrupos.com.br <delphi-br%40yahoogrupos.com.br>
> Subject: [delphi-br] Outra cor em linha do dbGrid
>
> Boa tarde pessoal
>
> Preciso que em um DbGrid em delphi 2007 apareça só 1 linha em outra cor e o
> restante continue em preto.Alguém pode me ajudar??
>
> Desde já agradeço
>
> --
> Atenciosamente
> Vanessa Oliveira
>
> [As partes desta mensagem que não continham texto foram removidas]
>
> ------------------------------------
>
> --
> <<<<< FAVOR REMOVER ESTA PARTE AO RESPONDER ESTA MENSAGEM >>>>>
>
> ***************************************************************************
> This e-mail and any files transmitted with it are confidential. If you are
> not the intended recipient, any reading, printing, storage, disclosure,
> copying or any other action taken in respect of this e-mail is prohibited
> and may be unlawful. If you are not the intended recipient, please notify
> the sender immediately by using the reply function and then permanently
> delete what you have received.
> Content of emails received by this Trust will be subject to disclosure
> under the Freedom of Information Act 2000, subject to the specified
> exemptions, including the Data Protection Act 1998 and Caldicott Guardian
> principles.
> This footnote also confirms that, unless otherwise stated, this email
> message has been swept by Sophos Anti-virus for the presence of computer
> viruses.
> ***************************************************************************
>
> 
>



-- 
Atenciosamente
Vanessa Oliveira


[As partes desta mensagem que não continham texto foram removidas]

Responder a