multiple color + font selections in a richtextbox control

G

Guest

hi, im trying to figure out how to get all the font and color selections of a
richt text box. for instance we could have this:

Red (formatted in red color and Arial font)
Green (formatted in green color and Times new Roman font)
Blue (formatted in blue color and Arial narrow font)

so im trying to figure out how i can find the formatting for each one
programmatically.
like, i need to convert the rtf into HTML, which is easy if the entire thing
is the same font or color. but how can i if the fonts and colors are
differrent? thanks
 
N

nime

I think you have to "scan" each char in the rictextbox.
First scan for colors and create an html equivalent.
Look at the first char and insert "<red>" for example
and scan other chars if they red or not, if you find another color
insert "<newcolor>" and so on...

Then scan for fonts.

Maybe you can scan for both color and font at the same time
to superimpose color and font attributes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top