Jumpy Guy
|
posted on 13/1/06 at 02:59 PM |
|
|
Delphi 7 help???
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
|
posted on 13/1/06 at 05:02 PM |
|
|
Tinker with this...
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.
Andy
|
|
Jumpy Guy
|
posted on 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
|
posted on 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
|
|