|
-
Feb 6th, 2002, 12:01 AM
#1
Thread Starter
PowerPoster
RichText Format Bold
What is the code in the rich text format to make a certain word bold? Say I have somthing like
(MidgetsBro) Hello
(Bob) Hey there buddy.
(MigetsBro) what's up?
etc...
How can I make the name and () bold?
I've tried making a simple RTF document with just one word bold, but it was really confusing how much coding it added when I saved it...
-
Feb 6th, 2002, 07:24 AM
#2
You can make it bold and change the color if you want.
VB Code:
Dim strWord As String
Dim lPos As Long
strWord = "Hello"
lPos = InStr(1, RichTextBox1.Text, strWord, vbTextCompare)
If lPos > 0 Then
With RichTextBox1
.SelStart = lPos - 1
.SelLength = Len(strWord)
.SelColor = vbRed
.SelBold = True
.SelStart = Len(RichTextBox1.Text)
End With
End If
-
Feb 6th, 2002, 04:45 PM
#3
Thread Starter
PowerPoster
Actually, I wanted to know the actual RTF coding. Not how to do it in a RichTextBox. I am making a chat program, and I want the names bolded, so I was thinking that I could send the formatting string along with the message. I thought it was somthing like {\b}BoldText{\b0} but I guess it isn't. I've decided to just search the string, and format it after it's received.
Thanks anyway.
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
|