Ver Mensaje Individual
  #6  
Antiguo 08-08-2011
Avatar de richy08
richy08 richy08 is offline
Miembro
 
Registrado: may 2007
Ubicación: Bucerias, Nayarit Mexico
Posts: 529
Reputación: 17
richy08 Va por buen camino
ya encontre el detalle el codigo queda asi

Código Delphi [-]
procedure TFrm_Main.DoOnClick(Sender: TObject);
var
i, seleccion : integer;
botonC : tbitbtn;
left, top: integer;
begin
  if Sender is TBitBtn then                                                           
  begin
    with TBitBtn(Sender) do
    begin
       Qry_Categoria.Close;
       Qry_Categoria.ParamByName('idlinea').Value:=tag;
       Qry_Categoria.Open;
    end;

    
       Left:=15;
       top:=16;

       i:=0;
       Seleccion:=0;
       Seleccion:=Qry_Categoria.RecordCount;

       While ido
       begin
          botonC := TBitBtn.Create(nil);
          botonC.Name:='btbc'+inttostr(Qry_Line.fieldbyname('idlinea').Value);
          botonC.Hint:=Qry_Categoria.fieldbyname('descripcion').Value;
          botonC.Left:= left;
          botonC.Top:=top;
          botonC.Width:=81;
          botonC.Height:=57;
          botonC.Parent:=Categoria;
      //    boton.OnClick:=;

          if FileExists('C:\Proyectos Delphi\Zibarita TouchScreen\Image\'+inttostr(Qry_Categoria.fieldbyname('idcat').Value)+'.bmp') then
          begin
            botonC.Glyph.LoadFromFile('C:\Proyectos Delphi\Zibarita TouchScreen\Image\'+inttostr(Qry_Categoria.fieldbyname('idcat').Value)+'.bmp');
            botonC.Caption:='';
          end
          else
            botonC.Caption:=Qry_Categoria.fieldbyname('idcat').Value;

         Qry_Categoria.next;
         top:=top+62;
         i:=i+1;
       end;
  end;
end;



saludos
Responder Con Cita