Incluir imagem no DBGrid????

Delphi

31/10/2006

Alguem sabe como incluir uma imagem no DBGrid?

No caso seria assim:

Se a tabelaXCAMPOX1 = ´XXXX´ entao
DBGrid recebe uma imagem bmp.
senao
DBGrid recebe uma outra imagem bmp.
Mais ou menos isso.

Essa imagem bmp pode estar dentro de uma pasta no diretorio de meu sistema ou pode estar dentro de um ImagemList.

Se puderem me ajudar ficaria muito grato!


Ronithd

Ronithd

Curtidas 0

Respostas

Queiroz

Queiroz

31/10/2006

Olá. Tenho um exemplo, publicado na revista ClubeDelphi; caso interese, mande o seu e-mail que lhe envio o exemplo.
[]s
Queiroz


GOSTEI 0
Ronithd

Ronithd

31/10/2006

Estou interessado sim.
Lhe enviei uma mp, pois não encontrei seu e-mail.


GOSTEI 0
Ronithd

Ronithd

31/10/2006

Valeu, me ajudou muito!

Funciona perfeito com este código:

  if Column.Field = cds_lista_fluxo_caixaFORMA then
  begin
    DBGrid1.Canvas.FillRect(rect);
    DBGrid1.DefaultDrawDataCell(rect,Column.Field,state);
    if cds_lista_fluxo_caixaFORMA.AsString = ´pagar´ then
      ImageList1.Draw(DBGrid1.Canvas,Rect.Left+0,Rect.Top+1,1);
    if cds_lista_fluxo_caixaFORMA.AsString = ´receber´ then
      ImageList1.Draw(DBGrid1.Canvas,Rect.Left+0,Rect.Top+1,0);
  end;



GOSTEI 0
POSTAR