unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Menus, unit1;
type
TForm2 =
class(TForm)
Timer1: TTimer;
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
Button2: TButton;
procedure FormShow(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
var
a:
string;
i:integer;
procedure LaufschriftLabel(ZuschreibenderTextAuswaehlen:
string;TimerAuswaehlen:TTimer;LabelAuswaehlen:TLabel);
begin
a:=ZuschreibenderTextAuswaehlen;
inc(i);
if i > length(a)
then
begin
TimerAuswaehlen.Enabled:=false;
exit;
end;
LabelAuswaehlen.caption:= LabelAuswaehlen.caption + a[i];
end;
procedure TForm2.FormShow(Sender: TObject);
begin
brush.Style:=bsclear;
label2.caption:='
';
end;
procedure TForm2.Timer1Timer(Sender: TObject);
begin
LaufschriftLabel('
Hallo das ist ein Test',timer1,label2);
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
label2.caption:='
';
i:=-1;
// hier müsste er die Globale Variable Zurücksetzen
timer1.Enabled:=true;
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
close;
form1.button1.Visible:=true;
end;
end.