Autor Beitrag
chriss1988
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 389

windows xp prof,home,windows98
delphi5
BeitragVerfasst: Do 16.03.06 15:16 
hi
also ich hab en kleines programm da soll bei der formcreat der label5 anfangen zublinken doch irgend wie will der net so wie ich, denn da tut sich rein garnichts.

ps es ist der timer2 der das machen soll

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:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
var
  Cover: TCover;
  Timer1:integer;
  zaehler:integer;  hier

implementation

uses Unit2;

{$R *.DFM}
procedure TCover.FormCreate(Sender: TObject);
begin
 showmessage('Herzích Willkommen bei dem Strategiespiel ?? 1.0beta');
 timer1.Enabled:=false;     //timer anfangs aus
 ladebalken.visible:=false;  //anfangs unsichtbar
 ladebalken.Max:=20;        // 20!
end;

procedure TCover.Label2Click(Sender: TObject);
begin
 timer1.Enabled:=true;        //timer beginnt
 ladebalken.visible:=true;    //balken wird sichtbar
 label4.visible:=true;
 label1.visible:=false;       //labels verschwinden
 label2.visible:=false;
 label3.visible:=false;

end;



procedure TCover.Timer1Timer(Sender: TObject);
begin
if ladebalken.Position=ladebalken.Max then    // balken gefüllt dann...
   begin
    menue.show;    //form2 zeigen
    cover.Hide;         //versteckt form1
    ladebalken.visible:=false;
    ladebalken.Position:=ladebalken.Min;
    timer1.Enabled:=false;
   end else
         ladebalken.Position:=ladebalken.Position +1;  //fügt einen balken zu
end;



procedure TCover.Timer2Timer(Sender: TObject); hier
begin
  if Zaehler=1 then label5.font.Color:=clmaroon;
  if Zaehler=2 then label5.font.Color:=clGray;
  if Zaehler=3 then label5.font.Color:=clmaroon;
  if Zaehler=4 then label5.font.Color:=clGray;
  if Zaehler=5 then label5.font.Color:=clmaroon;
  if Zaehler=6 then label5.font.Color:=clGray;
  if Zaehler=7 then label5.font.Color:=clmaroon;
  if Zaehler=8 then label5.font.Color:=clGray;
  if Zaehler=9 then label5.font.Color:=clmaroon;
  if Zaehler=10then label5.font.Color:=clGray;
  if Zaehler=11then label5.font.Color:=clmaroon;
  if Zaehler=12then label5.font.Color:=clGray;
  if Zaehler=13then label5.font.Color:=clmaroon;

end;
counterto
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 123

Win XP
Delphi 2005 Prof., Visual Basic 2005, PHP, My Sql, Visual Basic 6
BeitragVerfasst: Do 16.03.06 15:33 
hallo wenn du eine blinkende Schrift haben willst, dann musst du das so machen:
Komponenten: 2mal Timer, 1mal Label:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm2.Timer1Timer(Sender: TObject);
begin
label1.Caption:='ACHTUNG';
timer1.Enabled:=False; timer2.Enabled:=True;
end;

procedure TForm2.Timer2Timer(Sender: TObject);
begin
label1.Caption:='weiter';
timer2.Enabled:=False; Timer1.Enabled:=true;
end;


Kurz zum prinzip:
Timer 1 (Intervall) beschriftet das Label mit "Achtung", dannach schaltet dieser sich selbst aus, und schaltet Timer 2 an, (Intervall 2000), der die Beschriftung des Labels in "weiter" umwandelt.

Du musst jetzt halt den Code so umschreiben, dass er in dein programmm passt ;)

Moderiert von user profile iconTino: Code- durch Delphi-Tags ersetzt
chriss1988 Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 389

windows xp prof,home,windows98
delphi5
BeitragVerfasst: Do 16.03.06 15:37 
hab den fehler gefunden

ausblenden Delphi-Quelltext
1:
2:
Inc(Zaehler);
    Timer2.Interval:=600;
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Do 16.03.06 15:42 
Die Methode Timer2Timer ist alles andere als elegant programmiert.

Versuch es mal so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TCover.Timer2Timer(Sender: TObject);
begin 
  if label5.font.Color =clmaroon then
    label5.font.Color:=clGray
  else
    label5.font.Color:=clmaroon; 
end;


Lg Martin

_________________
Ein Nutzer der Ecke ;-)
chriss1988 Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 389

windows xp prof,home,windows98
delphi5
BeitragVerfasst: Do 16.03.06 15:43 
und so wechselt er ständig die farbe??
chriss1988 Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 389

windows xp prof,home,windows98
delphi5
BeitragVerfasst: Do 16.03.06 15:45 
jo danke das funktioniert super