Lazarus
Programming => Packages and Libraries => Topic started by: eldonfsr on December 05, 2024, 06:09:53 pm
-
is there a way to add char or string like typing on tmemo
i need trigger onkeypress like typing but mem.text := mem,text+'A' or mem.lines[2] := mem.lines[2]+'A'
can be possible?
-
I read your post multiple times, but I could not understand your question.
-
is there a way to add char or string like typing on tmemo
i need trigger onkeypress like typing but mem.text := mem,text+'A' or mem.lines[2] := mem.lines[2]+'A'
can be possible?
Hi eldonfsr
There are no OnKeyPress events in this case but for example OnChange event is triggered.
-
well is onchange is is trigger when i typing but let play with it enable and disable event..
-
is there a way to add char or string like typing on tmemo
It is not efficient to retrieve the entire Text, append to it, and then replace the entire Text. Try this simpler approach instead:
Mem.SelStart := Mem.GetTextLen;
Mem.SelLength := 0;
Mem.SelText := 'A';
That will append the new text to the end of the Memo's internal data.
-
well is onchange is is trigger when i typing but let play with it enable and disable event..
if you don't need the OnChange event, you can just ignore it.
-
"Memo1.Append" maybe ?
-
I think he wants to mimic real typing, so with a random delay between the characters?
I am not even bothered to write an example, because it is too easy.
If an answer is not there I will do it tomorrow. Hint: use randomrange(120,350) per char.