Autor Beitrag
TheNeon
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 408

Windows
VS2010 C#
BeitragVerfasst: Di 20.05.03 12:22 
wie kann ich eine Anweisung ( z.B. Label1.caption:='HALLO'; ) nach beispielsweise 3sec aufrufen lassen?

OHNE TIMER


Zuletzt bearbeitet von TheNeon am Di 20.05.03 14:07, insgesamt 2-mal bearbeitet
foxy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Di 20.05.03 12:23 
sleep(3000);

ist aber nich die tollste variante

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
TheNeon Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 408

Windows
VS2010 C#
BeitragVerfasst: Di 20.05.03 12:32 
foxy hat folgendes geschrieben:
sleep(3000);

ist aber nich die tollste variante


wird mit sleep nicht mein ganzes Prog "lahmgelegt" ?? der soll ja währenddessen noch was anderes machen .......
foxy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Di 20.05.03 12:37 
aso sag das doch ... kann ja keiner riechen

hmm... mit multithreat kenn ich mich nich aus sry... welche prozesse laufen denn noch ab?

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
ErnestoChe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 528

Win 2000 pro, CRUX 2.0
Delphi 6 Pers, Open K3
BeitragVerfasst: Di 20.05.03 12:42 
Hi,

GetTickCount liefert dir in millisekunden die Zeit die seit Systemstart vergangen ist. Damit kannst du dir auch helfen. Musst dir nur noch ne Formel ausdenken.

MFG

- Ernesto -
TheNeon Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 408

Windows
VS2010 C#
BeitragVerfasst: Di 20.05.03 12:50 
foxy hat folgendes geschrieben:
aso sag das doch ... kann ja keiner riechen

hmm... mit multithreat kenn ich mich nich aus sry... welche prozesse laufen denn noch ab?


... nicht gleich böse werden :wink2: ......
wollte den Befehl in Form1.OnCreate reinmachen ... hat sich aber erledigt ...... trotzdem danke :wink:
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Di 20.05.03 13:40 
Hallo,
du musst einfach eine Schleife konstruieren, die drei sekunden lang im Kreis läuft (die Werte kannst du dir mit GetTickCount oder auch now auswerten). In der Schleife musst du Application.ProcessMessages aufrufen, dammit das Programm nicht einfriert.

Gruß
Klabautermann
ErnestoChe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 528

Win 2000 pro, CRUX 2.0
Delphi 6 Pers, Open K3
BeitragVerfasst: Di 20.05.03 14:17 
Hi,

z.B. so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.Button1Click(Sender: TObject);
var
  i: int64;
begin
  i := GetTickCount;
  while gettickcount < i + 3000 do
  begin
    Label1.Caption := '';
    Application.ProcessMessages;
  end;
  Label1.Caption := 'hallo';
end;


MFG

- Ernesto -
TheNeon Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 408

Windows
VS2010 C#
BeitragVerfasst: Di 20.05.03 14:28 
DANKE euch :wink2: