Click here to Skip to main content
15,897,226 members
Home / Discussions / C#
   

C#

 
AnswerRe: InvalidCastException.. Pin
Rod Kemp27-Jan-10 20:15
Rod Kemp27-Jan-10 20:15 
AnswerRe: InvalidCastException.. Pin
SeMartens27-Jan-10 20:16
SeMartens27-Jan-10 20:16 
GeneralRe: InvalidCastException.. Pin
A.Machan Kachan27-Jan-10 20:35
A.Machan Kachan27-Jan-10 20:35 
GeneralRe: InvalidCastException.. Pin
SeMartens27-Jan-10 20:37
SeMartens27-Jan-10 20:37 
GeneralRe: InvalidCastException.. Pin
A.Machan Kachan27-Jan-10 21:13
A.Machan Kachan27-Jan-10 21:13 
GeneralRe: InvalidCastException.. Pin
SeMartens27-Jan-10 21:17
SeMartens27-Jan-10 21:17 
GeneralRe: InvalidCastException.. Pin
A.Machan Kachan27-Jan-10 21:22
A.Machan Kachan27-Jan-10 21:22 
Question"History" style text box Pin
User 137680027-Jan-10 19:39
User 137680027-Jan-10 19:39 
Hi all,
I'm writing what is essentially a kind of terminal emulator (for various reasons I can't use a pre-existing one, as this needs some pretty specific features).
One thing I'm a bit stuck on is trying to figure out how to make a custom control for the output text box. I need something that looks and acts somewhat like a textbox (however "read-only" from the user's perspective, as they enter commands in a separate control (or commands will be fired programmatically), and this control is just to show the output from the server.
The problem is, the "history". RichTextBoxes (and TextBoxes of course) have a maximum amount of characters. This is fine, and of course completely acceptable. However, when the control reaches it's maximum, I want it to behave in such a way that the oldest lines disappear from the start and the new lines come in at the end. As I will set the maximum length to be very long, doing this by taking ALL the text in the box, cutting the first line and then rewriting the whole lot in the text box again would be absolutely terrible for both memory usage and speed (i.e. totally unacceptable user experience). Such controls seem to be quite common for terminal emulators, telnet clients, MUD clients, custom consoles, etc, so I assume there should be some pretty nice examples out there, but I really can't find anything (every example of these types of apps I've come across seems to forget about this issue and doesn't handle what happens when the text box maximum is reached!)
It should ideally be derived from RichTextBox since I need colour support, however if it supports colour and looks somewhat like a text box, I'm happy to work with anything as I'll probably be modifying it heavily anyway. I'd also love it if it was entirely .NET managed code rather than making Windows specific calls since I intend my application to work under mono as well as on Windows... however if that's asking too much, I'll accept native Windows calls if that's what you suggest and then will come up with different methods for other platforms.
Any ideas?
AnswerRe: "History" style text box Pin
OriginalGriff27-Jan-10 21:51
mveOriginalGriff27-Jan-10 21:51 
GeneralRe: "History" style text box Pin
User 137680027-Jan-10 23:14
User 137680027-Jan-10 23:14 
GeneralRe: "History" style text box Pin
OriginalGriff28-Jan-10 0:26
mveOriginalGriff28-Jan-10 0:26 
GeneralRe: "History" style text box Pin
User 137680028-Jan-10 1:13
User 137680028-Jan-10 1:13 
GeneralRe: "History" style text box Pin
OriginalGriff28-Jan-10 1:31
mveOriginalGriff28-Jan-10 1:31 
GeneralRe: "History" style text box Pin
User 137680028-Jan-10 19:35
User 137680028-Jan-10 19:35 
QuestionCreate Service Pin
Sunil G27-Jan-10 19:19
Sunil G27-Jan-10 19:19 
AnswerRe: Create Service Pin
Richard MacCutchan27-Jan-10 22:16
mveRichard MacCutchan27-Jan-10 22:16 
GeneralRe: Create Service Pin
Sunil G27-Jan-10 22:23
Sunil G27-Jan-10 22:23 
GeneralRe: Create Service Pin
Richard MacCutchan27-Jan-10 23:02
mveRichard MacCutchan27-Jan-10 23:02 
AnswerRe: Create Service Pin
Nick Coombs28-Jan-10 6:58
Nick Coombs28-Jan-10 6:58 
QuestionERROR Pin
jojoba201027-Jan-10 19:09
jojoba201027-Jan-10 19:09 
AnswerRe: ERROR Pin
Dan Mos27-Jan-10 19:13
Dan Mos27-Jan-10 19:13 
QuestionRe: ERROR Pin
jojoba201027-Jan-10 19:41
jojoba201027-Jan-10 19:41 
AnswerRe: ERROR Pin
Rod Kemp27-Jan-10 20:07
Rod Kemp27-Jan-10 20:07 
QuestionRe: ERROR Pin
jojoba201027-Jan-10 22:20
jojoba201027-Jan-10 22:20 
AnswerRe: ERROR Pin
Rod Kemp27-Jan-10 22:41
Rod Kemp27-Jan-10 22:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.