Board index » cppbuilder » stripping colors from a richedit.

stripping colors from a richedit.

Hello people,

Lets say I have this Richedit control that has color in it (loaded in or
done by the user) How would I go about stripping the entire document in one
pass of all colors/text effects and just making the text black or whatever
the clWindowText setting is?

Thank you in advance...

Chris Webster

 

Re:stripping colors from a richedit.


Quote
Chris Webster wrote:

> Hello people,

> Lets say I have this Richedit control that has color in it (loaded in or
> done by the user) How would I go about stripping the entire document in one
> pass of all colors/text effects and just making the text black or whatever
> the clWindowText setting is?

Hi Chris,

If you're fiddling with RichEdit, check this site: (best thin not
owned by M$!)
    http://home.att.net/~robertdunn/Yacs.html

HTH

Bob

Re:stripping colors from a richedit.


Hi, Chris.

Quote
> Lets say I have this Richedit control that has color in it (loaded in or
> done by the user) How would I go about stripping the entire document in one
> pass of all colors/text effects and just making the text black or whatever
> the clWindowText setting is?

Select all of the text (RichEdit1->SelectAll()) and then apply the
desired font attributes.  Am I missing something?

robert

Re:stripping colors from a richedit.


Hello Robert,

Quote
Robert Dunn wrote in message <38F12D11.57A4...@worldnet.att.net>...
>Hi, Chris.

>> Lets say I have this Richedit control that has color in it (loaded in or
>> done by the user) How would I go about stripping the entire document in
one
>> pass of all colors/text effects and just making the text black or
whatever
>> the clWindowText setting is?

>Select all of the text (RichEdit1->SelectAll()) and then apply the
>desired font attributes.  Am I missing something?

Problem is... Here is the code:

   Editor->SelectAll();
   Editor->Font->Color = clWindowText;
   Editor->SelAttributes->Style = TFontStyles();
   Editor->SelLength = 0;

Okay so now what I don't understand is why doesn't this work? Or is there
something I am missing?

Thanks,

Chris

Re:stripping colors from a richedit.


Hi, Chris.

Quote
Chris Webster wrote:

> Problem is... Here is the code:

>    Editor->SelectAll();
>    Editor->Font->Color = clWindowText;

The above line changes the default text color, not the color of text
already in the control.  Change it to
        Editor->SelAttributes->Color = clWindowText;

Quote
>    Editor->SelAttributes->Style = TFontStyles();
>    Editor->SelLength = 0;

> Okay so now what I don't understand is why doesn't this work? Or is there
> something I am missing?

Does that fix it?

robert

Re:stripping colors from a richedit.


Thanks Robert! Worked great I don't know what I was thinking I was trying to
do but thanks for the explanation. :)

Chris

Other Threads