WPCubed Product Support

Setting font color

I want to be able set the font color in a DBWPRichText component - set the color of selected text otherwise set the current color attribute at the position of the cursor - to a specified color value.

Can someone offer example code for this or point to an existing example?

Thanks.

#1 ♥ 0
3.5k Views 2 links 2 users read 1 min
support

Hi,

You can use DBWPRichText1.CurrAttr.Color to change the text color. This is an index value, use CurrAttr.ColorToNr to convert a cl... color to such an index value.

Also see: [](http://www.wpcubed.com/manuals/wptools5/IDH_Class_TWPSetModeControl.htm)

Note: Before you change attributes in a DBWPRichText call Changing to make sure the dataset is in edit mode.

At a lower lever you can also use WritingAttr and SelectTextAttr - there you can use Get and Set methods to change attributes.
[](http://www.wpcubed.com/manuals/wptools5/idh_cat_wptools_5_attribute_interface.htm)

Regards,

Julian

Kind Regards,

Julian Ziersch

#2 ♥ 0

Thanks. Works great.

And thanks for the note about calling Changing to make sure the dataset is in edit mode as this reminder solved another problem as well.

#3 ♥ 0
This category is archived. No new posts are possible.