Results 1 to 8 of 8

Thread: [Resolved] [2005] Adding color to text in a RichTextBox

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2009
    Posts
    31

    [Resolved] [2005] Adding color to text in a RichTextBox

    Hi,

    I am opening an exe that launches in a hidden cmd window, and redirecting the text to a RichTextBox on a form.

    The problem is that the status messages in the cmd window are in color, but the redirected text in the RichTextBox has no color information and show as black on white.

    However, all the status messages in the cmd window have headers that could be parsed in some way so I can add color to them for my RichTextbox.

    For example, a message in the cmd window might read:

    [Warning] No settings file was found, using default values instead.

    This message is in Yellow in the cmd window.

    The text gets into my RichTextBox like this:

    Code:
    Dim SR As System.IO.StreamReader = myprocess.StandardOutput
    Results = SR.ReadToEnd
    SR.Close()
    txtResults.AppendText(Results)
    How could I intercept this text, check for the presence of [Warning], then color the entire line yellow?

    TIA

    Rock
    Last edited by Rock_Vacirca; Jan 25th, 2009 at 12:38 PM. Reason: resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width