I Currently have a trichedit with a scrollbar. This trichedit gets text from a socket and then adds that text to the bottom. Also if the total lines in the trichedit exceeds 100, the lines at the top are deleted. Im trying to keep the view at the bottom of the text by calling richedit1.perform(EM_SCROLL,SB_BOTTOM,0) but what happens is that as soon as lines are deleted via richedit1.lines.delete(0) the richedit scrolls to line 0 (the one being deleted). Therefore my perform and the lines.delete are constantly pulling the richedit from top to bottom and vice versa, causing a bit of flicker.
Anyone know how do either delete the lines "silently" or how to stop the flickering?
Heres my code:
output is the richedit, thestring is what im adding at the bottom.
procedure TMainForm.myprint(thestring: string);
while output.Lines.Count > 100 do
output.Lines.Delete(0); //this pulls the scrollbar top the top
output.SelStart := length(ausgabe.text);
output.SelText := thestring;
output.perform(EM_SCROLL,SB_BOTTOM,0); //this puts it back where its supposed to be