Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #3  
Antiguo 16-04-2008
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Poder: 27
Caral Va por buen camino
Hola
Este es un ejemplo de progressbar.
Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, ComCtrls;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure DialogTimer(Sender: TObject) ;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.DialogTimer(Sender: TObject) ;
var
   aPB : TProgressBar;
begin
   if NOT (Sender is TTimer) then Exit;

   if ((Sender as TTimer).Owner) is TForm then
   with ((Sender as TTimer).Owner) as TForm do
   begin
     aPB := TProgressBar(FindComponent('Progress')) ;

     if aPB.Position >= aPB.Max then
       ModalResult := mrCancel
     else
       aPB.StepIt;
   end;
end;

procedure TForm1.FormCreate(Sender: TObject);
var
   AMsgDialog : TForm;
   AProgressBar : TProgressBar;
   ATimer : TTimer;
begin
   AMsgDialog := CreateMessageDialog('El Programa se esta cargando, Espere', mtWarning, []) ;
   AProgressBar := TProgressBar.Create(AMsgDialog) ;
   ATimer := TTimer.Create(AMsgDialog) ;
   with AMsgDialog do
   try
    Tag := 5; // aqui se cambian los segundos

    Caption := 'En Proceso, espere';
    Height := 100;

    with AProgressBar do begin
     Name := 'Progress';
     Parent := AMsgDialog;
     Max := AMsgDialog.Tag;
     Step := 1;
     Top := 50;
     Left := 8;
     Width := AMsgDialog.ClientWidth - 16;
    end;

    with ATimer do
    begin
     Interval := 1000;
     OnTimer:=DialogTimer;
    end;

     case ShowModal of
     ID_CANCEL:
    //
    end;
   finally
    ATimer.OnTimer := nil;
    Free;
  end;
end;

end.
Saludos
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Enviar Mail con Indy + mostrar avance progressbar amadis Internet 7 03-02-2010 14:12:07
mostrar un porcentaje o progressbar rzf1983 Varios 8 25-10-2007 19:05:13
Error al mostrar el Preview URBANO Impresión 3 09-05-2007 09:41:59
dudas sobre reporte en cuanto preview y justificar Patricio Impresión 2 27-04-2007 16:56:34
El reporte no hace nada ilichhernandez Impresión 1 15-03-2007 22:26:20


La franja horaria es GMT +2. Ahora son las 18:08:22.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi