Autor Beitrag
Max
Hält's aus hier
Beiträge: 7



BeitragVerfasst: Mo 19.08.02 21:36 
Hallo !
Mache mich zum 1. Mal an Progressbar ran und hab keine Ahnung wie .
Kann mir bitte irgend jemand ein simples Beispiel zeigen ??????????

Danke :(
Max
Steffer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 299



BeitragVerfasst: Mo 19.08.02 21:41 
ProgressBar hat 2 wesentlich Eigenschaften, Max und Position.
Um zum Beispiel eine StringList mit Progressbar zu durchlaufen, würdest du das so schreiben:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
var Z : Integer;
begin
  Progressbar.Max:= StringList.Count;
  ProgressBar.Position:= 0;
  for Z:= 0 to StringList.Count - 1 do
  begin
    TueEtwas ...
    Progressbar.Position:= Progressbar.Position + 1;
    Progressbar.Update;
  end;
end;

_________________
Keine Signatur ...
DeCodeGuru
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1333
Erhaltene Danke: 1

Arch Linux
Eclipse
BeitragVerfasst: Mo 19.08.02 21:42 
Hi Max,

also die Progressbar wird benutzt um einen Fortschritt anzuzeigen. Hier haste mal ein kleines Beispiel:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.Button1Click(Sender: TObject);
var
  i: Integer;
begin
  ProgressBar1.Min := 0;  //Minimum einstellen
  ProgressBar1.Max := 100;  //Maximum einstellen
  for i := 0 to 99 do
  begin
    ProgressBar1.Position := i+1;  //Position um 1 erhöhen
    Sleep(10);  //10 Millisekunden warten
  end;
end;


Ich denke, dass der Code alles gut verdeutlicht. Benötigt wird ein Button und eine Progressbar. Probiers einfach mal aus.

_________________
Viele Grüße
Jakob
DeCodeGuru
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1333
Erhaltene Danke: 1

Arch Linux
Eclipse
BeitragVerfasst: Mo 19.08.02 21:43 
@Steffer: Du bist immer ne Minute schneller :mrgreen:

_________________
Viele Grüße
Jakob
Steffer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 299



BeitragVerfasst: Mo 19.08.02 22:23 
@DeCodeGuru

das sind die "magic fingers" ;-)

_________________
Keine Signatur ...
Max Threadstarter
Hält's aus hier
Beiträge: 7



BeitragVerfasst: Di 20.08.02 18:35 
Hi Leute !

Recht herzlichen Dank an STEFFER und DECODEGURU ,
hat mir erst einmal weiter geholfen .
Denn in Büchern ist nicht viel darüber zu finden .


Danke

Max :P
DeCodeGuru
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1333
Erhaltene Danke: 1

Arch Linux
Eclipse
BeitragVerfasst: Di 20.08.02 19:27 
Zitat:
das sind die "magic fingers" :wink:


Muss noch ein bisschen üben, um solche dollen Fingä zu bekomme :mrgreen:

_________________
Viele Grüße
Jakob