Printable Version | Subscribe | Add to Favourites
New Topic New Poll New Reply
Author: Subject: Delphi 7 help???
Jumpy Guy

posted on 13/1/06 at 02:59 PM Reply With Quote
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?

View User's Profile View All Posts By User U2U Member
andyd

posted on 13/1/06 at 05:02 PM Reply With Quote
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

View User's Profile View All Posts By User U2U Member
Jumpy Guy

posted on 16/1/06 at 01:48 PM Reply With Quote
Got it sorted!! a combination of SEL start and stop positions, and using a strange font..
ta.

View User's Profile View All Posts By User U2U Member
Gav

posted on 17/1/06 at 10:00 PM Reply With Quote
The might be worth a look rich edit example also if you have any further problems.
Its in the examples folder

View User's Profile Visit User's Homepage View All Posts By User U2U Member

New Topic New Poll New Reply


go to top






Website design and SEO by Studio Montage

All content © 2001-16 LocostBuilders. Reproduction prohibited
Opinions expressed in public posts are those of the author and do not necessarily represent
the views of other users or any member of the LocostBuilders team.
Running XMB 1.8 Partagium [© 2002 XMB Group] on Apache under CentOS Linux
Founded, built and operated by ChrisW.