Mega Code Archive

 
Categories / Delphi / VCL
 

Running caption of the label

Title: Running caption of the label Use Label and Timer components. It is necessary to repeat the last part of the string for getting "running" effect. procedure TForm1.Timer1Timer(Sender: TObject); const Str: string = 'It is necessary to repeat the last part' + 'of this string. It is necessary to re'; i: Integer = 1; Count: Integer = 20; begin Label1.Caption:=Copy(Str, i, Count); Inc(i); if i&gtLength(Str)-Count then i:=1; end;