Anyone help with Delphi?
I'm using a RichEdit box, with three lines of text.
i want to change the font halfway along one of the lines. I have no idea how to do this!!
i can change font from one line to the next -
with RichEdit1.SelAttributes do
begin
name := form1.edit2.font.name;
size := 9;
color := clblack;
end;
(* show date and time *)
form1.RichEdit1.Lines.Add(BuildDTStr);
but cant seem to change the font midway through one of the lines. Any ideas?
with RichEdit1 do
begin
Lines.Clear;
Lines.Add('Hello';
SelStart := 0;
SelLength := 1;
SelAttributes.Color := clRed;
SelText := 'World';
end;
Hope that kind of gives you enough of a clue to figure something out. It's all about the SelText etc.
Got it sorted!! a combination of SEL start and stop positions, and using a strange font..
ta.
The might be worth a look rich edit example also if you have any further problems.
Its in the examples folder