469,612 Members | 2,079 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,612 developers. It's quick & easy.

Finding Bold Text in RichTextbox

Finding Bold Text (or other formatting attributes) in RichTextbox .

Is it possible to find and select bold text by code within the text of a
RichTextbox? What I want is to manipulate the text into HTML code. Replace
the Bold text with <b>This is the bold text</bbefore I save it to an HTML

Dec 11 '06 #1
1 2794
I would read the RTF code to find the bolding. There is a property to
either read the text or read the RTF code in a rich text box.

Each section of special text is preceded with a header that describes
the font, color, bold, italic, etc., and is followed by a space. When
the bold is turned off, or any other change in the text layout, there
is another header for the next section of text.

The bold value is "/b". Bold is turned off when the next header section
does not have a "/b" in the formatting string.

You have to read the data and keep track of semaphores for the text
properties that you want to track. Was it on, and now it's off, and the

There may be a ".NET" way of doing it, but when I moved my project from
VB6 to .NET, I didn't have to change my old parsing code.

Hope the idea helps.

Dec 13 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by tshad | last post: by
3 posts views Thread by Robert Bravery | last post: by
4 posts views Thread by paraidy | last post: by
5 posts views Thread by Prose | last post: by
6 posts views Thread by =?Utf-8?B?bWlrZQ==?= | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.