RichTextBox Color Question---(easy question)

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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
 
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.
 

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.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Staff online

Members online

Top