Finding a StyleNo

General TRichView support forum. Please post your questions here
Post Reply
BernhardRoos
Posts: 104
Joined: Mon Nov 26, 2007 1:49 pm

Finding a StyleNo

Post 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
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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;
Post Reply