-----
Printable View
-----
You have to use a RichTextBox.
In code, use the RichTextBox's SelStart, SelLength, SelFont, etc. properties to change the color/fonts of ranges of text:
' make first 10 characters bold
RTF.SelStart = 0
RTF.SelLength = 10
RTF.SelBold = True
You could also use the microsoft internet control.
This would let people send each other embeded pictures and hyperlinks as well.
Just parse the data people send to make sure it is valid.
If someone sends you just a <b> then all your text in your chat window will go bold!!
I have used this and it words very well.
J.
Hey Guys
I need some info on the same subject "RTB 's" .
Can I append text to the box and keep the formating ,like the color and font style or Do I have to read the whole RTF and reformat it ever time I add to it ?
Thankx
Private1
You can either select text and then apply the format or you can directly modify the RTF code itself (this can end up getting very hardcore)
I'm downloading a bunch of samples right now on RTB's .
What are your thoughts on this . I made a chat client and I want to impliment colores and fonts . Did this before .
as you can imagine by the time there was a bunch written in the box that it flashed and scrolled alot . Where does one find the RTF codes to modify them ?Code:Public Sub colorize()
Dim posEnd, posStart, x, i As Integer
x = 0
i = 0
For i = 0 To Len(RichTextBox1.Text)
RichTextBox1.SelStart = i
RichTextBox1.SelLength = 1
If RichTextBox1.SelText = ">" Then 'start tag
posStart = i
RichTextBox1.SelColor = vbRed
End If
Next i
End Sub
Thnks again ,
Private