1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

RichTextBox Color Question---(easy question)

Discussion in 'Software Development' started by meatballman, Apr 19, 2004.

Thread Status:
Not open for further replies.
  1. meatballman

    meatballman Thread Starter

    Joined:
    Apr 18, 2004
    Messages:
    3
    Out of all the questions to ask, this one took up the most space on my whiteboard, so here goes.

    I am developing my own TELNET application. When data is recieved, I have a sub break it down, chatacter-by-character until it comes to a formatting tag. At the tag, it sets three Private RGB integers to the color specified, then, deletes the tag from the incoming string, and continues normally, applying the color formatting to the characters, and adding them to a RichTextBox. Sounds simple? Here's the question. When I apply the color formatting, it does not appear in the RichTextBox. Here is the code I use:

    Text1.SelColor = GetColor
    Text1.Text = Text1.Text + temp
    Text1.SelStart = Len(Text1.Text)
    Text = Right$(Text, Len(Text) - 1)

    Text1 is the RTB, temp is the character picked up, Text is the incoming string, GetColor is the RGB() of the three variables mentioned earlier. Yet, the color is not displayed. Why is this? :confused:

    Shouldn't be too hard for all of you.... :rolleyes:



    PS---I am programming in Visual Basic 6.0
     
  2. coderitr

    coderitr

    Joined:
    Oct 12, 2003
    Messages:
    3,015
    I'm not sure you can colorize an RTB without subclassing it and using the WinApi functions. I may be wrong though.
     
  3. meatballman

    meatballman Thread Starter

    Joined:
    Apr 18, 2004
    Messages:
    3
    I know you can do it without them because I've seen people do it before using that, and I've even used their techniques to do it myself in this fashion. The thing here is, I don't know what order the commands go in, like the selstart and selcolor.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/222050

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice