How can I create a “print” text effect on a timer? The question, as it were, is “printed”, increasing by one letter. Component-Tmemo

  • In which component should this be implemented? In TImage, TMemo, where? - AseN
  • In the TMemo component - Savillon

2 answers 2

Hands, all hands ...

The idea is simple. You hang up a handler on the timer, in each iteration of which you add one character to the text in TMemo from the string that should come out. When the line is over you stop the timer.

I will not write the code. For someone who wants to figure it out too much.

  • 2
    In-in, it is not necessary to write such terribly simple code. By the way, the question seems to stem from one of my answers. - DelphiM0ZG

Is it really so difficult: to create the effect of the printed text in the simplest component to use?

procedure TForm1.Timer1Timer(Sender: TObject); // событие "OnTimer" begin memo1.Lines.Text:=memo1.Lines.Text+CHR(Random(254)+40); // печатаем... end; 

Set the timer interval in the range from 100 to 600 ms

  • one
    600 a lot, I once checked on the program outputting graphics - half a second and a person starts to think that the program hung - aknew