|
-
Aug 5th, 2002, 12:22 AM
#1
Thread Starter
Hyperactive Member
alternative color for RichTextBox
I want to make a chat program and I use RichTextBox to display the conversation
how to display it in Colors .. for example my color is red,, and the other is blue
Code:
RichTextBox1.Text = RichTextBox1.Text & myText & vbCrLf
RichTextBox1.Text = RichTextBox1.Text & comingText & vbCrLf
-
Aug 5th, 2002, 12:30 AM
#2
PowerPoster
You need to find the start of the message, then the end, and then select the whole thing, and colour it.
-
Aug 5th, 2002, 12:40 AM
#3
Lively Member
You need to select the text, then color it.
VB Code:
dim OldMsgLen, NewMsgLen as integer
OldMsgLen = len (rich.text)
NewMsgLen = len (IncomingWinsockData)
rich.text = rich.Text & IncomingWinsockData)
rich.selstart = OldMsgLen
rich.sellength = NewMsgLen
rich.selcolor = vbRed
Pretty much the same for your text as it is for theirs, I'm sure you can figure it out.
-
Aug 5th, 2002, 12:49 AM
#4
Thread Starter
Hyperactive Member
thanks for your help guys
sorry I cannot figure it out
-
Aug 5th, 2002, 12:53 AM
#5
PowerPoster
lol
I'll see if I can dig up some code...
-
Aug 5th, 2002, 12:59 AM
#6
Lively Member
i'll look too, I wrote a chat program a while ago, maybe i can find it. It worked a bit differently though. It highlighted just the user names, kinda like AIM or MSN.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|