Autor Beitrag
Krefti
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 164

Win XP/Vista/Win7/ubuntu
Delphi 7/2006/2009 Pro
BeitragVerfasst: Di 02.01.07 18:35 
Abend ihr zusammen..

habn kleines problem mit meinem label..

ich möchte einen text in einem label 1,5 anzeigen lassen, dann eine halbe sekunde pause, dann den nächsten text..
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
    lblWoerter.Visible:=false;
    lblWort2.Visible:=false;
    lblWort3.Visible:=false;
    sleep(1000);
    lblWoerter.Caption:='Sonne';
    lblWoerter.Font.Color:=clyellow;
    lblWoerter.Visible:=true;
    sleep(1500);
    lblWoerter.Visible:=false;
    sleep(500);
    lblWort2.Caption:='Meer';
    lblWort2.font.color:=clblue;
    lblWort2.Visible:=true;
    sleep(1500);
    lblWort2.Visible:=false;
    sleep(500);
    lblWort3.Caption:='Gras';
    lblwort3.font.color:=clgreen;
    lblWort3.Visible:=true;


könnt ihr mir sagen, warum er alles durchläuft nix anzeigt und zum schluss dann des letzte anzeigt??? ich glaub ich steh grad voll aufm schlauch..
vielen dank scho mal..
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Di 02.01.07 18:37 
Machs entweder mit Application-ProcessMessages oder mit nem Timer.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Krefti Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 164

Win XP/Vista/Win7/ubuntu
Delphi 7/2006/2009 Pro
BeitragVerfasst: Di 02.01.07 18:39 
könntest mir ma bitte eh beispiel gebbe???? danke
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Di 02.01.07 18:40 
nö, wozu gibts denn die Suchfunktion :roll:

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Di 02.01.07 18:41 
Wie wärs mal mit der Suche?? Mit Google?
Du schreibst einfach Application.ProcessMessages; nach der Zuweisung der neuen Caption hin, eben überall dort, wo die Änderung gemacht und sofort sichtbar werden soll.
Krefti Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 164

Win XP/Vista/Win7/ubuntu
Delphi 7/2006/2009 Pro
BeitragVerfasst: Di 02.01.07 18:43 
oha..bist du immer so freundlich??? wär dir trotzdem verbunden, wenn du mir eins gebbe würdest..
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Di 02.01.07 18:44 
Wofür? Du findest zu diesem Befehl in der Delphi Hilfe (F1) und über die Suche massig Infos!
Und was du machen musst habe ich dir auch hingeschrieben.
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: Di 02.01.07 18:49 
[OT]
Es ist immer wieder toll, wenn in einem Programmierforum bei einer ganz spezifischen Programmierfrage auf Google verwiesen wird. :roll:
[/OT]

Zum Thema: Auch wenn es schon gesagt wurde: Füge an den Stellen im Code, an denen die Änderung wirksam werden soll, ein Application.ProcessMessages ein. Also z.B. vor jeder Sleep-Anweisung. Das bewirkt hier, dass die Nachricht "Hallo, liebes Programm, da muss ein Label neu gezeichnet werden" (weil sich die Caption verändert hat) verarbeitet wird. Ansonsten gehts nämlich erst in der Prozedur weiter, und erst danach wird einmal neu gezeichnet.

_________________
We are, we were and will not be.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Di 02.01.07 18:55 
user profile iconGausi hat folgendes geschrieben:
[OT]
Es ist immer wieder toll, wenn in einem Programmierforum bei einer ganz spezifischen Programmierfrage auf Google verwiesen wird. :roll:
[/OT]
Das habe ich geschrieben, weil man bei einer Suche nach Application.ProcessMessages sowohl hier im Forum als auch bei Google Beispiele und Erklärungen erhält. Genau wie in der OH.
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Di 02.01.07 19:39 
Hallo
Du kannst auch Refresh benutzen.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
lblWoerter.Visible:=false;
    lblWort2.Visible:=false;
    lblWort3.Visible:=false;
    sleep(1000);
    lblWoerter.Caption:='Sonne';
    lblWoerter.Font.Color:=clyellow;
    lblWoerter.Visible:=true;
    lblWoerter.Refresh;
    sleep(1500);
    lblWoerter.Visible:=false;
    sleep(500);
    lblWort2.Caption:='Meer';
    lblWort2.font.color:=clblue;
    lblWort2.Visible:=true;
    lblWort2.Refresh;
    sleep(1500);
    lblWort2.Visible:=false;
    sleep(500);
    lblWort3.Caption:='Gras';
    lblwort3.font.color:=clgreen;
    lblWort3.Visible:=true;
    lblWort3.Refresh;

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
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: Mi 03.01.07 12:50 
Die Diskussion über Quellcode posten vs. Suche habe ich hierhin abgetrennt.

_________________
We are, we were and will not be.