Autor Beitrag
91KEY8
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 105


Delphi 3
BeitragVerfasst: Mo 07.08.06 19:09 
Hallo!

Ich habe in meinem Programm einen Timer integriert. Nun möchte ich, dass auf einer Progressbar der Progress vom aktivieren des Formulars bis zum Timer automatisch bis 100% weitergeht. Wie geht das ????

mfg 91KEY8 :D
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mo 07.08.06 19:17 
Erkläre das bitte genauer.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Mo 07.08.06 19:20 
Im Timer einfach ProgressBar1.Position := ProgressBar1.Position + 1; ? oder hab ichs jetzt falsch verstanden :?

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
91KEY8 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 105


Delphi 3
BeitragVerfasst: Mo 07.08.06 19:23 
user profile iconBorn-to-Frag hat folgendes geschrieben:
Im Timer einfach ProgressBar1.Position := ProgressBar1.Position + 1; ? oder hab ichs jetzt falsch verstanden :?


das Funktioniert leider nicht so ganz. Ich möchte, dass die Progressbar langsam nach oben (bis zu 100%) geht, bis der Timer timt, also die Zeit erreicht ist, dann sollte er bei 100% sein.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 07.08.06 19:34 
Dann nimm einen zweiten Timer, der nur ein hundertstel des ersten als Intervall hat. :mrgreen:

Besser wäre so etwas:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
if timer1.tag < 100 then
begin
  timer1.tag := timer1.tag + 1;
  Progressbar1.Position := Progressbar1.Position + 1;
end else
begin
  timer1.tag := 0;
  Progressbar1.Position := 0;
  // mach noch ganz viel mehr
  // ...
  // ...
  // ...
end;
Natürlich das Intervall entsprechend kürzer machen.

_________________
We are, we were and will not be.