Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Library: Windows API / MS.NET Framework API (https://www.delphipraxis.net/20-library-windows-api-ms-net-framework-api/)
-   -   Delphi Wie Scrolle ich Text in der Caption des Formulares? (https://www.delphipraxis.net/2608-wie-scrolle-ich-text-der-caption-des-formulares.html)

Daniel B 30. Jan 2003 17:57


Wie Scrolle ich Text in der Caption des Formulares?
 
Delphi-Quellcode:
var
  Scroll: Integer = 0;

procedure TForm1.Timer1Timer(Sender: TObject);
//Scrollende Caption des Formulares
//Es wird eine Timer-Komponente benötigt
//Unter Intervall stellt man die Geschwindigkeit des Scrollens fest.
var
  i, n: Integer;
  s, ScrollText: String;
begin
  n := 3; //Anzahl der zu sehenden Zeichen
  ScrollText := 'Mein Scrollender Text!'; //Der Text der gescrollt werden soll
  Inc(Scroll); //Zähler hochzählen
  if Scroll > Length(ScrollText) -3 then
  Scroll := 0;
  For i := 1 to n do
    s := s + ScrollText[i + Scroll];
  Form1.Caption := s;
  Application.Title := s;
end;
Grüsse, Daniel :hi:


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:01 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz