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
Finding a StyleNo
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
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;