Color code "live" text output?

jungalist

Member
Joined
Jul 20, 2006
Messages
5
Programming Experience
Beginner
I am a web programmer and am a bit unsure of the controls used in Windows Forms, so this may be a very basic question.

Basic Outline:
I am trying to create a Windows App that monitors a text log file. When the file has a new entry, the App grabs the new text, performs a regex comparison and applies various colors depending on the textual content. Finally it appends this newly formatted text to the end of the existing string on the Windows Form's display control.

Progress:
I have the "read the file line by line, check for certain text, make changes accordingly" functionality working. The problem is: How should I be changing the string? I have tried HTML tags with a RichTextBox control, as well as adding color settings with RichTextBox.RTF and then placing formatting code into the string to coincide with that. None of this works.

I can get different text to change color in the RichTextBox if the text already exists, but I need to set the formatting in the string so that it is in place by the time it hits the display control. Or do I? Am I think too "Webby" here? Does it matter if I format the contents of the RichTextBox each time a line is read on a locally run application? I am used to dealing with Request/Response, which has some limiting factors.

Summary:
I need to know if there is a control that is made for this type of formatting (either via displaying HTML or its own formatting tags) or how to achieve this end "on-the-fly" using the RichTextBox control


A bit wordy, I know. Any help is appreciated.
 
If you want to use something more familiar to you you could use a WebBrowser control! It might not be the best way of doing it, but it is probably easiest for you and it should do the job.
 
Back
Top