Delphi-PRAXiS
Seite 1 von 3  1 23      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Erbitte Hilfe bei MarqueeProgressBar !! (https://www.delphipraxis.net/95934-erbitte-hilfe-bei-marqueeprogressbar.html)

Störtebeker 16. Jul 2007 12:23


Erbitte Hilfe bei MarqueeProgressBar !!
 
Ich verwende für meinen SplashScreen eine MarqueeProgressBar, das Problem ist nur, dass sie sich im Minutentakt einen Schritt weiter bewegt und nicht flüssig läuft, wie man das von Windows XP kennt. :(

Delphi-Quellcode:
program Project4;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2},
  Unit3 in 'Unit3.pas' {Form3},
  Unit4 in 'Unit4.pas' {Form4},
  SplashScreen in 'SplashScreen.pas' {Form5};

{$R *.res}

begin
  Application.Initialize;
  Form5 := TForm5.Create(Application);

    with TForm5.Create(nil) do
  try
  Form5.Show;
  Form5.Update;

  MarqueeProgressBar1.Max := 100;
    Show;  // Startbildschirm mit ProgressBar anzeigen
    Update; // Anzeige von Form5 auslösen

  Application.Initialize;
  Application.Title := 'Project4';
  Application.CreateForm(TForm4, Form4);
  MarqueeProgressBar1.StepBy(25);
  Application.CreateForm(TForm1, Form1);
  MarqueeProgressBar1.StepBy(25);
  Application.CreateForm(TForm3, Form3);
  MarqueeProgressBar1.StepBy(25);
  Application.CreateForm(TForm2, Form2);
  MarqueeProgressBar1.StepBy(25);
   Finally
   free;
  Form5.visible :=false;
  end;
  Application.Run;

end.
das wäre der code, wobei nes sich bei Form5 um die SplashScreen Form handelt.

scrat1979 16. Jul 2007 12:32

Re: Erbitte Hilfe bei MarqueeProgressBar !!
 
Hallo!

Hilfe eventuell ein Application.ProcessMessages weiter??

Delphi-Quellcode:
Application.CreateForm(TForm4, Form4);
MarqueeProgressBar1.StepBy(25);
Application.ProcessMessages;
SCRaT

Störtebeker 16. Jul 2007 12:35

Re: Erbitte Hilfe bei MarqueeProgressBar !!
 
Ne, leider hat das nicht geholfen.

Code sieht jetzt so aus, und bringt leider auch keine Hilfe:

Delphi-Quellcode:
program Project4;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2},
  Unit3 in 'Unit3.pas' {Form3},
  Unit4 in 'Unit4.pas' {Form4},
  SplashScreen in 'SplashScreen.pas' {Form5};

{$R *.res}

begin
  Application.Initialize;
  Form5 := TForm5.Create(Application);

    with TForm5.Create(nil) do
  try
  Form5.Show;
  Form5.Update;

  MarqueeProgressBar1.Max := 100;
    Show;  // Startbildschirm mit ProgressBar anzeigen
    Update; // Anzeige von Form5 auslösen

  Application.Initialize;
  Application.Title := 'Project4';
  Application.CreateForm(TForm4, Form4);
  MarqueeProgressBar1.StepBy(25);
  Application.ProcessMessages;
  Application.CreateForm(TForm1, Form1);
  MarqueeProgressBar1.StepBy(25);
  Application.ProcessMessages;
  Application.CreateForm(TForm3, Form3);
  MarqueeProgressBar1.StepBy(25);
  Application.ProcessMessages;
  Application.CreateForm(TForm2, Form2);
  MarqueeProgressBar1.StepBy(25);
  Application.ProcessMessages;
   Finally
   free;
  Form5.visible :=false;
  end;
  Application.Run;

end.

Luckie 16. Jul 2007 12:36

Re: Erbitte Hilfe bei MarqueeProgressBar !!
 
Ruf mal nach
Delphi-Quellcode:
MarqueeProgressBar1.StepBy(25);
ein
Delphi-Quellcode:
MarqueeProgressBar1.Refresh
auf.

Störtebeker 16. Jul 2007 12:40

Re: Erbitte Hilfe bei MarqueeProgressBar !!
 
:( Ne, hat leider auch nichts gebracht.

:?: Kann es vielleicht sein, dass ich die restlichen Formen schon ganz anders aufrufen muss?

KrasserChecker 16. Jul 2007 13:28

Re: Erbitte Hilfe bei MarqueeProgressBar !!
 
Hallo,

dauert das Erstellen der anderen Formulare so lange?

Wenn das "...CreateForm()" jedesmal so viel Zeit in Anspruch nimmt tut sich natürlich während dessen nichts im ProgressBar. Du setzt die Anzeige ja immer um 25 hoch. Das heißt aber nicht(!), daß die Anzeige dann autom. schön sanft den Fortschrittsbalken länger macht, sondern daß der Balken "ruckartig" (und vor allen sofort) verlängert wird.

Vermutlich wirst Du das anders lösen müssen (Stichwort: Hintergrundthread). Allerdings ist dann dein Hauptproblem, daß Du nicht weißt, wie lange das erzeugen eines einzelnen Formulars dauert.

Störtebeker 16. Jul 2007 13:40

Re: Erbitte Hilfe bei MarqueeProgressBar !!
 
Na die Formulare sind mit der Eigenschaft "sleep(2500);" versehen, damit der SplashScreen auch ein bisschen länger zu sehen ist.

Matze 16. Jul 2007 13:44

Re: Erbitte Hilfe bei MarqueeProgressBar !!
 
Bei Sleep() friert das ganze Programm ein. Nutze stattdessen lieber DelayDelay.

Störtebeker 16. Jul 2007 14:07

Re: Erbitte Hilfe bei MarqueeProgressBar !!
 
Und wo baue ich dieses Delay ein ??

Apollonius 16. Jul 2007 14:17

Re: Erbitte Hilfe bei MarqueeProgressBar !!
 
Statt sleep.


Alle Zeitangaben in WEZ +1. Es ist jetzt 08:37 Uhr.
Seite 1 von 3  1 23      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz