Thema: Delphi lauftext

Einzelnen Beitrag anzeigen

Benutzerbild von PigfaceJoe
PigfaceJoe

Registriert seit: 17. Dez 2006
Ort: Saarland
24 Beiträge
 
Delphi 7 Personal
 
#5

Re: lauftext

  Alt 17. Aug 2007, 13:17
Hi, meine Lösung is nicht die beste, klappt aber

Delphi-Quellcode:
implementation
var b:boolean;

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
begin
if (text.top<400 (*Dein Wert, muss der slebe sein wie unten der*) )and (not b ) then
begin
if text.left< 450(*DEIN WERT*) then text.left:=text.left+10 else
if text.top <400(*DEIN WERT*) then text.Top:=text.Top+10 ;
b:=false;
end else
begin
if text.left>text.width then begin b:=true; text.left:=text.left-10 end else
if text.top>10 then begin b:=true;text.Top:=text.Top-10 end else b:=false;
end
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
b:=false;
end;

end.
Gruss
PigfaceJoe

//EDIT:
Und so klappts auch , wenn man die Form in die Breite oder Höhe zieht.
Delphi-Quellcode:
begin
if (text.top<clientheight-text.Height*2 (*Dein Wert, muss der slebe sein wie unten der*) )and (not b ) then
begin
if text.left< clientwidth-text.width *2(*DEIN WERT*) then text.left:=text.left+10 else
if text.top <clientheight-text.Height*2 then text.Top:=text.Top+10 ;
b:=false;
end else
begin
if text.left>text.width then begin b:=true; text.left:=text.left-10 end else
if text.top>10 then begin b:=true;text.Top:=text.Top-10 end else b:=false;
end
end;
Max
Glühlampen brennen heller, wenn man sie vor dem Einschrauben aus der Verpackung nimmt.
  Mit Zitat antworten Zitat