Home All Groups Group Topic Archive Search About

Finding Bold Text in RichTextbox

Author
11 Dec 2006 12:29 AM
Tor Inge Rislaa
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</b> before I save it to an HTML
file.



TIRislaa

Author
13 Dec 2006 4:53 PM
Shane
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
like.

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.
Shane
Author
29 Mar 2010 11:27 AM
Armin Zingler
Am 29.03.2010 12:38, schrieb priya:
> plz send me the code for this subject
>

Would you be so kind to quote what you are referring to if
the message is more than three years old? Thx.


--
Armin