Ken,
Two fairly easy things I can think of with say a RichTextEdit window.
The lines property is basically an array of strings. Every time a line is
added to the window, you should make the newest line visible, that will
keep your smaller window view into the 200 lines always at the last entry.
Secondly, every time a couple of lines ares added and you are over 200,
delete just the first few. This should ensure that your scrollbar doesn't
jump arround too much. I have not tried this, and its possible that the
extra redraws you may see would also not be desirable.
Instead you could have a string [200] and once full you delete the first
to add a new at the end ie; remove mystrarr[0], add mystrarr[199]. Then in 1
shot you could set the editbox text to the contents of your string array-
thus only encurring one redraw.
Just some thoughts.
Erin.
"Ken Williams" <g3***@gb7abc.net> wrote in message
news:bh**********@news8.svr.pol.co.uk...
Hi can anyone point me to some sample source code for a scrolling window.
What I want is a text window that monitors incoming data continuously, so
it has to hold say a couple of hundred lines then after that the early lines
need to erase as new data arrives.
The only way I have seen this done is by copying to a buffer, deleting the
first bit then putting it back in a text window.
It does work, but it causes the scroll bar to quickly jump, you don't
often see it, but it just doesn't seem very elegant, there must be a better way.
Ken