Autor Beitrag
Adryr
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18

Win XP und Win7
Delphi 7
BeitragVerfasst: Fr 14.05.10 15:11 
Hi

ich hab ein kleines Problem.
und zwar möchte ich eine neue Form öffnen und die soll nach 5 sek (oder so) wieder automatisch geschlossen werden.

ich hab das mit dem
ausblenden Delphi-Quelltext
1:
2:
Sleep(5000);
close;

schon probiert
(zumindest im OnCreate- und OnActivate ereignis)

gibt es eventuell noch andere möglichkeiten?

danke schon mal im voraus

mfg Adryr
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Fr 14.05.10 15:16 
probiers mal das du es dort reinschreibst wo du form2.show; aufrufst.

btw: du weißt das während dem sleep deine anwendung auf keine ereignisse und nachrichten reagieren kann?

lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
bummi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1248
Erhaltene Danke: 187

XP - Server 2008R2
D2 - Delphi XE
BeitragVerfasst: Fr 14.05.10 15:17 
Timer aktivieren welcher das Fenster schließt ??
Adryr Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18

Win XP und Win7
Delphi 7
BeitragVerfasst: Fr 14.05.10 15:37 
danke

das mit dem Form2.show hat nicht funktioniert und ja ich weiß, dass man beim sleep nichts mehr machen (das war auch meine absicht)

das mit dem timer funktioniert
danke

mfg Adryr
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Fr 14.05.10 15:39 
user profile iconAdryr hat folgendes geschrieben Zum zitierten Posting springen:
danke

das mit dem Form2.show hat nicht funktioniert


hast du nur close; geschrieben oder form2.close? denn bei mir hat das einwandfrei funktioniert?

lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
Adryr Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18

Win XP und Win7
Delphi 7
BeitragVerfasst: Fr 14.05.10 15:49 
ich hatte nur close geschrieben

mfg Adryr
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Fr 14.05.10 15:53 
du musst natürlich dann auch form2.close schreiben, alleine weiß der compiler nicht welches fenster zu jetzt schließen willst. ;)

ich hatte bei mir im test 2 formulare, auf form1 war ein button der form2 für 5 sekunden angezeigt hat und dann wieder geschlossen hat, form2 war leer. In die OnClick-Procedure von Button auf Form1 hab ich folgendes geschrieben:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.Button1Click(Sender: TObject);
begin
  form2.show;
  sleep(5000);
  form2.close;
end;


hat bei mir einwandfrei funktioniert.

lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
Adryr Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18

Win XP und Win7
Delphi 7
BeitragVerfasst: Fr 14.05.10 16:31 
ok danke
naja mit dem timer hat es auch funktioniert

mfg Adryr