user3293636
user3293636

Reputation: 13

vb.net - richtextbox: Bold text between <b> strings

I have a RichTextBox (a chat). I want to bold the names. How to do it?

for example the richtextbox:

<b>Name1</b>: Hello!
<b>Name2</b>: Hi!
<b>Name3</b>: Hey!

How can I change the names to bold and remove the strings?

Name1: Hello!

Name2: Hi!

Name2: Hey!

?

Upvotes: 0

Views: 2943

Answers (1)

Gent
Gent

Reputation: 2685

http://msdn.microsoft.com/en-us/library/aa287595(v=vs.71).aspx

You basicly need to inject the following into the string

richTextBox1.Rtf = @"{\rtf1\ansi This is in \b bold\b0.}";

Upvotes: 0

Related Questions