Einzelnen Beitrag anzeigen

Benutzerbild von Störtebeker
Störtebeker

Registriert seit: 9. Jul 2007
398 Beiträge
 
#1

SplashScreen Problem

  Alt 18. Okt 2008, 23:28
Hallo,

kleine Nebenbemerkung: Ich arbeite in Lazarus:

ich verwende für mein Programm einen Splash und wollte nun etwas kombinieren, von dem meine vorherige Programme jeweils nur eines besaßen.

Kombination: ProgressBar und Label

Code der Programm-Unit

Delphi-Quellcode:
program Project;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms
  { you can add units after this }, main, robots, splash;

{$IFDEF WINDOWS}{$R manifest.rc}{$ENDIF}

begin
  Application.Initialize;

  Form3 :=TForm3.Create(Application);
  with TForm3.Create(nil) do
  try
  Form3.show;
  Form3.Update;

  Application.Initialize;
  ProgressBar1.Max:=100;
  Show;
  Update;
  Application.Title:= 'Project';
  Application.CreateForm(TForm1, Form1);
  ProgressBar1.StepBy(30);
  Application.CreateForm(TForm2, Form2);
  ProgressBar1.StepBy(80);
  Finally
  free;
  Form3.visible :=false;
  end;
  Application.Run;
end.
Codeausschnitt für eines der weiteren Formulare:
Delphi-Quellcode:
.
.
.
procedure TForm2.FormCreate(Sender: TObject);
begin
sleep(2500);
Form2.DoubleBuffered := true;
Form3.Label8.Caption:='System will be analyzed...';
Form3.Refresh;
end;
.
.
.
Also, der Splash erscheint, die Progressbar lädt. Gleichzeitig soll ein Label anzeigen, was das Programm gerade macht. Ohne ProgressBar funzt es. Aber nicht mit der ProgressBar. Was muss ich machen, damit die Kombination funktioniert?
"And he piled upon the whale´s white hump - a sum of all the rage and hate felt by his whole race.
If his chest had been a cannon, he would have shot his heart upon it."
  Mit Zitat antworten Zitat