Page 1 of 1

Finding a StyleNo

Posted: Fri Feb 01, 2008 8:18 am
by BernhardRoos
Hello,
I have a control (for example TEdit) in a RichView. This control has a font and I want to know which StyleNo can be used.
The reason is, I delete the control at runtime and insert instead a Textitem which has the same font and color.
Is there a quick method to find out which styleno I can use.
Best wishes
Bernhard

Posted: Sun Feb 03, 2008 5:26 pm
by Sergey Tkachenko

Code: Select all

Result := RVStyle1.TextStyles.FindStyleWithFont(Edit1.Font);
if Result<0 then begin
  RVStyle1.TextStyles.Add;
  Result := RVStyle1.TextStyles.Count-1;
  RVStyle1.TextStyles[Result].Assign(Edit1.Font);
  RVStyle1.TextStyles[Result].Standard := False;
end;