|
-
Dec 23rd, 2005, 06:12 PM
#1
Thread Starter
Fanatic Member
Simulate a console terminal with a RichTextBox
OK, I've tried a couple different approaches with a RichTextBox but am stumped. I basically want to simulate a console window in a control, but with some added functionality. I will be writing lines into bottom of the control from a Winsock, and want it to scroll upward like a VT100 terminal. I also want to be able to add formatting to the incoming text on the fly. This is no problem. The problem is that I would also like a vertical scroll bar to be able to review the last couple of hundred lines. The best approach I could come up with was to use a RichTextBox, update it when a line comes through from the Winsock with added formatting, write the whole thing back to the RTB, and set the cursor to the end. This works fine when it is being updated infrequently, but when line start coming faster than 1 every 10th of a second or so, it starts flickering as the SelStart moves from the top to the bottom. The only thing that I could think of was to hook it's paint event and only have it repaint after the SelStart was set. Anyone have other ideas?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|