1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Rep Power

    Coloured text within text box

    Hey people.

    Right... I've come up against something very difficult. However it sounds really easy.

    I am basically writing an application to work as a CommWatch program (to display the data going between machines).
    It has a couple of ports, lets say for this instance Port A and Port B.

    Basically.... I want to put data into a text box (or rich text box) and colour it according to which port it came in on (Red = A, Blue = B).

    I have got text changing colour... but as soon as I move onto the next one the previous ones revert to the default colour.

    Can anyone help me or recommend to me a custom control to use perhaps?

    Thanks in advance.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Rep Power

    How are you applying the color to the text?

    I had a project a while back that involved formatting text in a rich text box and I remember that I had to select the section of text that I wanted to format first and then apply formatting to it similar to:

    rtbViewOutput.SelectionStart = <some start point>
    rtbViewOutput.SelectionLength = <some length of selection>
    rtbViewOutput.SelectionColor = Color.Red

    I know I had different formatting on different sections of text.

    Hope that helps!


IMN logo majestic logo threadwatch logo seochat tools logo