As part of an app I'm writing that utilizes a modem, I need to have some simple terminal emulation. It works perfectly, except for one thing. When I recieve data, I append it to a RichTextBox with a line like
Code:
RTBox.Text=RTBox.Text & data[\code]
and I'd like the user to be able to see the incoming data as it goes in, i.e. I want the box to scroll down automatically as more data is put into it.
Normally, whenever you change the .text property, the cursor goes back to the very first line, so I put the following in the change event:
[code]
Output_box.SelStart = Len(Output_box.Text)
Output_box.SelLength = 0
[\code]
This forces the cursor to the bottom of the box, but it doesn't work too well when I'm adding lots of data very fast. The box starts to flicker and it just generally gets ugly.
There has to be a better way to do this. Anyone have any ideas?