Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
var
Form1: TForm1;
list: TStringList;
procedure TForm1.FormCreate(Sender: TObject);
begin
label1.Caption := '';
label1.AutoSize := True;
label1.Color := clInactiveBorder;
list := TStringList.Create;
list.Add('Титры');
list.Add('Какой-то текст');
list.Add('');
list.Add('1');
list.Add('2');
list.Add('3');
list.Add('');
list.Add('4');
list.Add('5');
end;
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: boolean);
begin
list.Free;
end;
procedure MoveTitle();
var
item: string;
begin
while (True) do
begin
if (Form1.Button1.Tag = 0) then
exit;
Form1.Label1.Caption := '';
for item in list do
begin
Form1.label1.Caption := Form1.label1.Caption + #13 + item;
end;
list.Insert(0, list[list.Count - 1]);
list.Delete(list.Count - 1);
Application.ProcessMessages;
Sleep(500);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if (button1.Tag = 0) then
begin
button1.Tag := 1;
MoveTitle;
end
else
button1.Tag := 0;
end;
Formally, this elementary solution comes into question:
On the TMemo form Num lines high (exactly or there are more lines of text than lines on the screen). We fill in all Num lines, including empty ones. And then we turn them on the timer:
s := Memo1.Lines[Num-1];
Memo1.Lines.Delete(Num-1);
Memo1.Lines.Insert(0, s);
But, of course, you won’t get beautiful (smooth) titles that way.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question