Here's a second idea to help you out. On your form, drop two timers, a label, and three buttons. Label your buttons, Scroll left, scroll right, and quit.
Here is the implementation:
implementation
{$R *.DFM}
procedure TForm1.Button3Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ScrollText := ' This is a demonstration of scrolling text ';
Label1.Caption := ScrollText;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Timer2.Enabled := true;
Timer1.Enabled := false;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
NewText : AnsiString;
SLen : Integer;
Sub : AnsiString;
begin
{ get the rightmost character from scrolltext }
SLen := Length(ScrollText);
Sub := ScrollText[SLen];
{ trim the strings }
ScrollText := Copy(ScrollText, 1, SLen -1);
NewText := Sub + ScrollText;
Label1.Caption := NewText;
ScrollText := NewText;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Timer1.Enabled := true;
Timer2.Enabled := false;
end;
procedure TForm1.Timer2Timer(Sender: TObject);
var
NewText : AnsiString;
SLen : Integer;
Sub : AnsiString;
begin
{ get the leftmost character from scrolltext }
SLen := Length(ScrollText);
Sub := ScrollText[1];
{ trim the strings }
ScrollText := Copy(ScrollText, 2, SLen -1);
NewText := ScrollText + Sub;
Label1.Caption := NewText;
ScrollText := NewText;
end;
end.