Board logo

Delphi 7 help???
Jumpy Guy - 13/1/06 at 02:59 PM

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?


andyd - 13/1/06 at 05:02 PM

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.


Jumpy Guy - 16/1/06 at 01:48 PM

Got it sorted!! a combination of SEL start and stop positions, and using a strange font..
ta.


Gav - 17/1/06 at 10:00 PM

The might be worth a look rich edit example also if you have any further problems.
Its in the examples folder