Autor Beitrag
superchatti
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 296

Win XP, Red Hat Linux 7.3
Delphi 6 PE
BeitragVerfasst: Mi 14.05.03 19:48 
Also!
Ich würde gerne das wenn ich auf Knopf 1 drücke eine Form gezeigt wird wo in einem Label von zum Beispiel 10 runtergezählt wird und dann wird ein Button in dem Form enabled!
Wie realisiere ich sowas?

_________________
mfG Superchatti
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 14.05.03 19:58 
Such mal im Forum nach Countdown. Das hatten wir schon oft.
BungeeBug
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 901



BeitragVerfasst: Mi 14.05.03 20:01 
Hi,
also den Button Enabeln is einfach
ausblenden Delphi-Quelltext
1:
Button1.Enabled := true;					

und was hast du weiter vor?


MfG BungeeBug
Horst
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 120



BeitragVerfasst: Mi 14.05.03 20:09 
Hallo superchatti,

Meine Lösung wäre:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
var
  cCountDown,
  cStartZeit : string;

function Zeit2sec(cZeit:string):longint;
var sec : longint;
    p : byte;
begin
  sec:=0;
  p:=pos(':',cZeit);
  if p>1 then
    begin
    sec:=strtoint(copy(cZeit,1,p-1))*60;
    sec:=sec+strtoint(copy(cZeit,p+1,length(cZeit)-p));
    end;
  result:=sec;
end;

procedure TFormUebersicht.FormActivate(Sender: TObject);
begin
    cStartZeit:=timetostr(time);
    cCountDown:=holini(cgIniDatei,'ALLGEMEIN','COUNTDOWN','02:00');
end;

procedure TFormUebersicht.Timer1Timer(Sender: TObject);
var nCountDown : longint;
begin
    nCountDown:=zeit2sec(cCountDown)-
                (zeit2sec(copy(timetostr(time),4,5))-zeit2sec(copy(cStartZeit,4,5)));
    if nCountDown<0 then
        // Countdown abgelaufen, dann Fenster schliessen  
        close;
end;

Statt "close" muss du den Button dann enablen. statt "holini" kannst die Zeitdauer auch fest setzen:
ausblenden Quelltext
1:
cCountdown := '00:10' // bedeutet z.B. 10 sec.					

Gruß

Horst
:wave:

Moderiert von user profile iconTino: Delphi-Tags hinzugefügt.
superchatti Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 296

Win XP, Red Hat Linux 7.3
Delphi 6 PE
BeitragVerfasst: Mi 14.05.03 20:14 
Danke Horst!

_________________
mfG Superchatti