Solved

Loading Screen

Posted on 2003-11-04
4
154 Views
Last Modified: 2010-04-05
Hey,

How would I create a loading screen that fakes a load e.g
It shows a progress bar loading but Its not loading it just makes it look good ?

Cheers,

Computer Programer
0
Comment
Question by:computerprogramer
  • 4
4 Comments
 
LVL 22

Accepted Solution

by:
senad earned 50 total points
ID: 9683418
progress bar and a timer
0
 
LVL 22

Expert Comment

by:senad
ID: 9686040
Here is the code :
(Put a progress bar and a timer on the form)


unit prog;

interface

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

type
  TForm1 = class(TForm)
    ProgressBar1: TProgressBar;
    Timer1: TTimer;
    procedure FormCreate(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  ProgressBar1.Position:=0;
  Timer1.Enabled := True;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  ProgressBar1.Visible:=True;
  Randomize;
  if Random(1) = 0 then ProgressBar1.Position:=ProgressBar1.Position+1;
  if (ProgressBar1.Position = 100) then
  begin

    Timer1.Enabled := False;
    ProgressBar1.Visible:=False;
    //MessageDlg('Progress Bar Finished',mtConfirmation,[MBOK],0);
    //Form1.Destroy;

 end;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  Close;
end;

end.
0
 
LVL 22

Expert Comment

by:senad
ID: 9686052
so in progress barr increase the MAX if you want it to "play" longer ...
0
 
LVL 22

Expert Comment

by:senad
ID: 9686070
example : set max to 300 (progresss bar)
and in above code
if (ProgressBar1.Position = 300) then..
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now