Recent

Author Topic: Imagem no Buttom dentro do DBGrid  (Read 2774 times)

andersonscinfo

  • Full Member
  • ***
  • Posts: 132
Imagem no Buttom dentro do DBGrid
« on: May 24, 2014, 04:07:11 pm »
Bom dia, estou usando o seguinte metodo para colocar uma imagen dentro de um Buttom no DBGrid:

Code: [Select]
procedure TForm.DBGrid1DrawColumnCell(Sender: TObject;
  const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
  if Column.ButtonStyle = cbsButtonColumn then
    begin
        DMImages.ImageList16x16.Draw(DBGrid1.Canvas, Rect.Left+5,
        Rect.Top+2, 28); //28 é index da imagem no imagelist
    end;
end;

minha pergunta é, existe alguma outra forma melhor de fazer isso, ou esta é a forma correta de fazer?

Att.
Anderson Junior

 

TinyPortal © 2005-2018