trichview.com

trichview.support




Re: How to create Textstyles


Return to index


Author

Message

Sergey Tkachenko

Posted: 02/14/2003 19:30:15


How to add red bold text style:


var fi: TFontInfo;

fi := RVStyle1.TextStyles.Add;

fi.Style := [fsBold[;

fi.Color := clRed;


Another example:


var fi: TFontInfo;

     StyleNo: Integer;


fi := TFontInfo.Create(nil);

fi.Style := [fsBold[;

fi.Color := clRed;

// may be such style already exists?

// searching for it

StyleNo := RVStyle1.TextStyles.FindSuchStyle(0, fi,

RVAllFontInfoProperties);

if StyleNo<0 then begin // not found. adding

  RVStyle1.TextStyles.Add;

  StyleNo := RVStyle1.TextStyles.Count-1;

  RVStyle1.TextStyles[StyleNo].Assign(fi);

end;

fi.Free;

// resulting style is RVStyle1.TextStyles[StyleNo]



>

> Hello,

> I want to programatically(at runtime) create a new textstyles in the

RVStyle

> component. I want the text color to be red and bold font(fsBold). Then add

> the newly created textstyles to the existing list.

>

> How can I achieve this?





Powered by ABC Amber Outlook Express Converter